Merge branch 'master' of https://github.com/phpmyadmin/phpmyadmin into UT_plu_table

This commit is contained in:
adamgsoc2013 2013-07-17 23:55:55 +08:00
commit 87b514fc11
65 changed files with 3831 additions and 1322 deletions

View File

@ -25,6 +25,7 @@ phpMyAdmin - ChangeLog
- [core] Dropped support for PHP 5.2.
+ rfe #487 and rfe #1405 Find and Replacing column wise
+ rfe #1373 Use same create view dialog for editing a view
+ rfe #316 Configurable menus; allow user groups with customized menus per group
4.0.5.0 (not yet released)
- bug #3977 Not detected configuration storage
@ -35,6 +36,7 @@ phpMyAdmin - ChangeLog
- bug #3985 Call to undefined function mb_detect_encoding
- bug #4007 Analyze option not shown for InnoDB tables
- bug #4015 Forcing a storage engine for configuration storage
- bug Incorrect Drizzle 7 detection
4.0.4.1 (2013-06-30)
- [security] Global variables scope injection vulnerability (see PMASA-2013-7)

View File

@ -59,6 +59,8 @@ $cfg['Servers'][$i]['AllowNoPassword'] = false;
// $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
// $cfg['Servers'][$i]['users'] = 'pma__users';
// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

View File

@ -110,7 +110,7 @@ Basic settings
column names match with words which are MySQL reserved.
If you want to turn off this warning, you can set it to ``true`` and
warning will not longer be displayed
warning will no longer be displayed.
.. config:option:: $cfg['TranslationWarningThreshold']
@ -649,6 +649,29 @@ Server connection settings
* put the table name in :config:option:`$cfg['Servers'][$i]['table\_uiprefs']` (e.g.
``pma__table_uiprefs``)
.. _configurablemenus:
.. config:option:: $cfg['Servers'][$i]['users']
:type: string
:default: ``''``
.. config:option:: $cfg['Servers'][$i]['usergroups']
:type: string
:default: ``''``
Since release 4.1.0 you can create different user groups with menu items
attached to them. Users can be assigned to these groups and the logged in
user would only see menu items configured to the usergroup he is assigned to.
To do this it needs two tables "usergroups" (storing allowed menu items for each
user group) and "users" (storing users and their assignments to user groups).
To allow the usage of this functionality:
* set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage
* put the correct table names in
:config:option:`$cfg['Servers'][$i]['users']` (e.g. ``pma__users``) and
:config:option:`$cfg['Servers'][$i]['usergroups']` (e.g. ``pma__usergroups``)
.. _tracking:
.. config:option:: $cfg['Servers'][$i]['tracking']

View File

@ -45,4 +45,6 @@ foreach ($hosts as $host) {
$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
}

View File

@ -239,3 +239,66 @@ CREATE TABLE IF NOT EXISTS `pma__userconfig` (
)
COMMENT='User preferences storage for phpMyAdmin'
DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
-- --------------------------------------------------------
--
-- Table structure for table `pma__users`
--
CREATE TABLE IF NOT EXISTS `pma__users` (
`username` varchar(64) NOT NULL,
`usergroup` varchar(64) NOT NULL,
PRIMARY KEY (`username`,`usergroup`)
)
COMMENT='Users and their assignments to user groups'
DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
-- --------------------------------------------------------
--
-- Table structure for table `pma__usergroups`
--
CREATE TABLE IF NOT EXISTS `pma__usergroups` (
`usergroup` varchar(64) NOT NULL,
`server_databases` enum('Y','N') NOT NULL DEFAULT 'N',
`server_sql` enum('Y','N') NOT NULL DEFAULT 'N',
`server_status` enum('Y','N') NOT NULL DEFAULT 'N',
`server_rights` enum('Y','N') NOT NULL DEFAULT 'N',
`server_export` enum('Y','N') NOT NULL DEFAULT 'N',
`server_import` enum('Y','N') NOT NULL DEFAULT 'N',
`server_settings` enum('Y','N') NOT NULL DEFAULT 'N',
`server_binlog` enum('Y','N') NOT NULL DEFAULT 'N',
`server_replication` enum('Y','N') NOT NULL DEFAULT 'N',
`server_vars` enum('Y','N') NOT NULL DEFAULT 'N',
`server_charset` enum('Y','N') NOT NULL DEFAULT 'N',
`server_plugins` enum('Y','N') NOT NULL DEFAULT 'N',
`server_engine` enum('Y','N') NOT NULL DEFAULT 'N',
`db_structure` enum('Y','N') NOT NULL DEFAULT 'N',
`db_sql` enum('Y','N') NOT NULL DEFAULT 'N',
`db_search` enum('Y','N') NOT NULL DEFAULT 'N',
`db_qbe` enum('Y','N') NOT NULL DEFAULT 'N',
`db_export` enum('Y','N') NOT NULL DEFAULT 'N',
`db_import` enum('Y','N') NOT NULL DEFAULT 'N',
`db_operation` enum('Y','N') NOT NULL DEFAULT 'N',
`db_privileges` enum('Y','N') NOT NULL DEFAULT 'N',
`db_routines` enum('Y','N') NOT NULL DEFAULT 'N',
`db_events` enum('Y','N') NOT NULL DEFAULT 'N',
`db_triggers` enum('Y','N') NOT NULL DEFAULT 'N',
`db_tracking` enum('Y','N') NOT NULL DEFAULT 'N',
`db_designer` enum('Y','N') NOT NULL DEFAULT 'N',
`table_browse` enum('Y','N') NOT NULL DEFAULT 'N',
`table_structure` enum('Y','N') NOT NULL DEFAULT 'N',
`table_sql` enum('Y','N') NOT NULL DEFAULT 'N',
`table_search` enum('Y','N') NOT NULL DEFAULT 'N',
`table_insert` enum('Y','N') NOT NULL DEFAULT 'N',
`table_export` enum('Y','N') NOT NULL DEFAULT 'N',
`table_import` enum('Y','N') NOT NULL DEFAULT 'N',
`table_operation` enum('Y','N') NOT NULL DEFAULT 'N',
`table_tracking` enum('Y','N') NOT NULL DEFAULT 'N',
`table_triggers` enum('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`usergroup`)
)
COMMENT='User groups with configured menu items'
DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;

View File

@ -225,3 +225,66 @@ CREATE TABLE IF NOT EXISTS `pma__userconfig` (
)
COMMENT='User preferences storage for phpMyAdmin'
COLLATE utf8_bin;
-- --------------------------------------------------------
--
-- Table structure for table `pma__users`
--
CREATE TABLE IF NOT EXISTS `pma__users` (
`username` varchar(64) NOT NULL,
`usergroup` varchar(64) NOT NULL,
PRIMARY KEY (`username`,`usergroup`)
)
COMMENT='Users and their assignments to user groups'
COLLATE utf8_bin;
-- --------------------------------------------------------
--
-- Table structure for table `pma__usergroups`
--
CREATE TABLE IF NOT EXISTS `pma__usergroups` (
`usergroup` varchar(64) NOT NULL,
`server_databases` enum('Y','N') NOT NULL DEFAULT 'N',
`server_sql` enum('Y','N') NOT NULL DEFAULT 'N',
`server_status` enum('Y','N') NOT NULL DEFAULT 'N',
`server_rights` enum('Y','N') NOT NULL DEFAULT 'N',
`server_export` enum('Y','N') NOT NULL DEFAULT 'N',
`server_import` enum('Y','N') NOT NULL DEFAULT 'N',
`server_settings` enum('Y','N') NOT NULL DEFAULT 'N',
`server_binlog` enum('Y','N') NOT NULL DEFAULT 'N',
`server_replication` enum('Y','N') NOT NULL DEFAULT 'N',
`server_vars` enum('Y','N') NOT NULL DEFAULT 'N',
`server_charset` enum('Y','N') NOT NULL DEFAULT 'N',
`server_plugins` enum('Y','N') NOT NULL DEFAULT 'N',
`server_engine` enum('Y','N') NOT NULL DEFAULT 'N',
`db_structure` enum('Y','N') NOT NULL DEFAULT 'N',
`db_sql` enum('Y','N') NOT NULL DEFAULT 'N',
`db_search` enum('Y','N') NOT NULL DEFAULT 'N',
`db_qbe` enum('Y','N') NOT NULL DEFAULT 'N',
`db_export` enum('Y','N') NOT NULL DEFAULT 'N',
`db_import` enum('Y','N') NOT NULL DEFAULT 'N',
`db_operation` enum('Y','N') NOT NULL DEFAULT 'N',
`db_privileges` enum('Y','N') NOT NULL DEFAULT 'N',
`db_routines` enum('Y','N') NOT NULL DEFAULT 'N',
`db_events` enum('Y','N') NOT NULL DEFAULT 'N',
`db_triggers` enum('Y','N') NOT NULL DEFAULT 'N',
`db_tracking` enum('Y','N') NOT NULL DEFAULT 'N',
`db_designer` enum('Y','N') NOT NULL DEFAULT 'N',
`table_browse` enum('Y','N') NOT NULL DEFAULT 'N',
`table_structure` enum('Y','N') NOT NULL DEFAULT 'N',
`table_sql` enum('Y','N') NOT NULL DEFAULT 'N',
`table_search` enum('Y','N') NOT NULL DEFAULT 'N',
`table_insert` enum('Y','N') NOT NULL DEFAULT 'N',
`table_export` enum('Y','N') NOT NULL DEFAULT 'N',
`table_import` enum('Y','N') NOT NULL DEFAULT 'N',
`table_operation` enum('Y','N') NOT NULL DEFAULT 'N',
`table_tracking` enum('Y','N') NOT NULL DEFAULT 'N',
`table_triggers` enum('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`usergroup`)
)
COMMENT='User groups with configured menu items'
COLLATE utf8_bin;

View File

@ -172,6 +172,7 @@ AJAX.registerTeardown('server_privileges.js', function () {
$('form[name=usersForm]').unbind('submit');
$("#fieldset_delete_user_footer #buttonGo.ajax").die('click');
$("a.edit_user_anchor.ajax").die('click');
$("a.edit_user_group_anchor.ajax").die('click');
$("#edit_user_dialog").find("form.ajax").die('submit');
$("button.mult_submit[value=export]").die('click');
$("a.export_user_anchor.ajax").die('click');
@ -300,6 +301,75 @@ AJAX.registerOnload('server_privileges.js', function () {
}); // end $.post()
}); // end Revoke User
$("a.edit_user_group_anchor.ajax").live('click', function (event) {
event.preventDefault();
$(this).parents('tr').addClass('current_row');
var token = $(this).parents('form').find('input[name="token"]').val();
var $msg = PMA_ajaxShowMessage();
$.get(
$(this).attr('href'),
{
'ajax_request': true,
'edit_user_group_dialog': true,
'token': token
},
function (data) {
if (data.success === true) {
PMA_ajaxRemoveMessage($msg);
var buttonOptions = {};
buttonOptions[PMA_messages.strGo] = function () {
var usrGroup = $('#changeUserGroupDialog')
.find('select[name="userGroup"]')
.val();
var $message = PMA_ajaxShowMessage();
$.get(
'server_privileges.php',
$('#changeUserGroupDialog').find('form').serialize() + '&ajax_request=1',
function (data) {
PMA_ajaxRemoveMessage($message);
if (data.success === true) {
$("#usersForm")
.find('.current_row')
.removeClass('current_row')
.find('.usrGroup')
.text(usrGroup);
} else {
PMA_ajaxShowMessage(data.error, false);
$("#usersForm")
.find('.current_row')
.removeClass('current_row');
}
}
);
$(this).dialog("close");
};
buttonOptions[PMA_messages.strClose] = function () {
$(this).dialog("close");
};
var $dialog = $('<div/>')
.attr('id', 'changeUserGroupDialog')
.append(data.message)
.dialog({
width: 500,
minWidth: 300,
modal: true,
buttons: buttonOptions,
title: $('legend', $(data.message)).text(),
close: function () {
$(this).remove();
}
});
$dialog.find('legend').remove();
} else {
PMA_ajaxShowMessage(data.error, false);
$("#usersForm")
.find('.current_row')
.removeClass('current_row');
}
}
);
});
/**
* AJAX handler for 'Edit User'
*

View File

@ -99,17 +99,65 @@ class PMA_Menu
{
$tabs = array();
$url_params = array('db' => $this->_db);
$level = '';
if (strlen($this->_table)) {
$tabs = $this->_getTableTabs();
$url_params['table'] = $this->_table;
$level = 'table';
} else if (strlen($this->_db)) {
$tabs = $this->_getDbTabs();
$level = 'db';
} else {
$tabs = $this->_getServerTabs();
$level = 'server';
}
$allowedTabs = $this->_getAllowedTabs($level);
foreach ($tabs as $key => $value) {
if (! array_key_exists($key, $allowedTabs)) {
unset($tabs[$key]);
}
}
return PMA_Util::getHtmlTabs($tabs, $url_params, 'topmenu', true);
}
/**
* Returns a list of allowed tabs for the current user for the given level
*
* @param string $level 'server', 'db' or 'table' level
*
* @return array list of allowed tabs
*/
private function _getAllowedTabs($level)
{
$allowedTabs = PMA_Util::getMenuTabList($level);
$cfgRelation = PMA_getRelationsParam();
if ($cfgRelation['menuswork']) {
$groupTable = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb'])
. "." . PMA_Util::backquote($GLOBALS['cfg']['Server']['usergroups']);
$userTable = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb'])
. "." . PMA_Util::backquote($GLOBALS['cfg']['Server']['users']);
$sql_query = "SELECT * FROM " . $groupTable
. " WHERE `usergroup` = (SELECT usergroup FROM "
. $userTable . " WHERE `username` = '"
. PMA_Util::sqlAddSlashes($GLOBALS['cfg']['Server']['user']) . "')";
$result = PMA_queryAsControlUser($sql_query, false);
if ($result) {
$row = $GLOBALS['dbi']->fetchAssoc($result);
foreach ($allowedTabs as $key => $tab) {
$colName = $level . '_' . $key;
if (isset($row[$colName]) && $row[$colName] == 'N') {
unset($allowedTabs[$key]);
}
}
}
}
return $allowedTabs;
}
/**
* Returns the breadcrumbs as HTML
*
@ -130,21 +178,13 @@ class PMA_Menu
$item = '<a href="%1$s?%2$s" class="item">';
if (in_array(
$GLOBALS['cfg']['TabsMode'],
array('text', 'both')
)
) {
if (in_array($GLOBALS['cfg']['TabsMode'], array('text', 'both'))) {
$item .= '%4$s: ';
}
$item .= '%3$s</a>';
$retval .= "<div id='floating_menubar'></div>";
$retval .= "<div id='serverinfo'>";
if (in_array(
$GLOBALS['cfg']['TabsMode'],
array('icons', 'both')
)
) {
if (in_array($GLOBALS['cfg']['TabsMode'], array('icons', 'both'))) {
$retval .= PMA_Util::getImage(
's_host.png',
'',
@ -161,11 +201,7 @@ class PMA_Menu
if (strlen($this->_db)) {
$retval .= $separator;
if (in_array(
$GLOBALS['cfg']['TabsMode'],
array('icons', 'both')
)
) {
if (in_array($GLOBALS['cfg']['TabsMode'], array('icons', 'both'))) {
$retval .= PMA_Util::getImage(
's_db.png',
'',
@ -187,11 +223,7 @@ class PMA_Menu
include './libraries/tbl_info.inc.php';
$retval .= $separator;
if (in_array(
$GLOBALS['cfg']['TabsMode'],
array('icons', 'both')
)
) {
if (in_array($GLOBALS['cfg']['TabsMode'], array('icons', 'both'))) {
$icon = $tbl_is_view ? 'b_views.png' : 's_tbl.png';
$retval .= PMA_Util::getImage(
$icon,
@ -444,11 +476,9 @@ class PMA_Menu
{
$is_superuser = isset($GLOBALS['dbi']) && $GLOBALS['dbi']->isSuperuser();
$binary_logs = null;
if (isset($GLOBALS['dbi'])
&& (! defined('PMA_DRIZZLE')
|| (defined('PMA_DRIZZLE') && ! PMA_DRIZZLE)
)
) {
$notDrizzle = ! defined('PMA_DRIZZLE')
|| (defined('PMA_DRIZZLE') && ! PMA_DRIZZLE);
if (isset($GLOBALS['dbi']) && $notDrizzle) {
$binary_logs = $GLOBALS['dbi']->fetchResult(
'SHOW MASTER LOGS',
'Log_name',
@ -486,6 +516,10 @@ class PMA_Menu
$tabs['rights']['icon'] = 's_rights.png';
$tabs['rights']['link'] = 'server_privileges.php';
$tabs['rights']['text'] = __('Users');
$tabs['rights']['active'] = in_array(
basename($GLOBALS['PMA_PHP_SELF']),
array('server_privileges.php', 'server_user_groups.php')
);
}
$tabs['export']['icon'] = 'b_export.png';

View File

@ -4153,6 +4153,69 @@ class PMA_Util
return $regex;
}
/**
* Return the list of tabs for the menu with corresponding names
*
* @param string $level 'server', 'db' or 'table' level
*
* @return array list of tabs for the menu
*/
public static function getMenuTabList($level = null)
{
$tabList = array(
'server' => array(
'databases' => __('Databases'),
'sql' => __('SQL'),
'status' => __('Status'),
'rights' => __('Users'),
'export' => __('Export'),
'import' => __('Import'),
'settings' => __('Settings'),
'binlog' => __('Binary log'),
'replication' => __('Replication'),
'vars' => __('Variables'),
'charset' => __('Charsets'),
'plugins' => __('Plugins'),
'engine' => __('Engines')
),
'db' => array(
'structure' => __('Structure'),
'sql' => __('SQL'),
'search' => __('Search'),
'qbe' => __('Query'),
'export' => __('Export'),
'import' => __('Import'),
'operation' => __('Operations'),
'privileges' => __('Privileges'),
'routines' => __('Routines'),
'events' => __('Events'),
'triggers' => __('Triggers'),
'tracking' => __('Tracking'),
'designer' => __('Designer')
),
'table' => array(
'browse' => __('Browse'),
'structure' => __('Structure'),
'sql' => __('SQL'),
'search' => __('Search'),
'insert' => __('Insert'),
'export' => __('Export'),
'import' => __('Import'),
'operation' => __('Operations'),
'tracking' => __('Tracking'),
'triggers' => __('Triggers'),
)
);
if ($level == null) {
return $tabList;
} else if (array_key_exists($level, $tabList)) {
return $tabList[$level];
} else {
return null;
}
}
/**
* Returns information with latest version from phpmyadmin.net
*
@ -4191,9 +4254,8 @@ class PMA_Util
$cfg['VersionCheckProxyUser'] . ':'
. $cfg['VersionCheckProxyPass']
);
$context['http']['header'] =
'Proxy-Authorization: Basic '
. $auth;
$context['http']['header']
= 'Proxy-Authorization: Basic ' . $auth;
}
}
$response = file_get_contents(

View File

@ -402,6 +402,24 @@ $cfg['Servers'][$i]['tracking'] = '';
*/
$cfg['Servers'][$i]['userconfig'] = '';
/**
* table to store users and their assignment to user groups
* - leave blank to disable configurable menus feature
* SUGGESTED: 'pma__users'
*
* @global string $cfg['Servers'][$i]['users']
*/
$cfg['Servers'][$i]['users'] = '';
/**
* table to store allowed menu items for each user group
* - leave blank to disable configurable menus feature
* SUGGESTED: 'pma__usergroups'
*
* @global string $cfg['Servers'][$i]['usergroups']
*/
$cfg['Servers'][$i]['usergroups'] = '';
/**
* Maximum number of records saved in $cfg['Servers'][$i]['table_uiprefs'] table.
*

View File

@ -450,6 +450,10 @@ $strConfigServers_tracking_version_auto_create_desc = __('Whether the tracking m
$strConfigServers_tracking_version_auto_create_name = __('Automatically create versions');
$strConfigServers_userconfig_desc = __('Leave blank for no user preferences storage in database, suggested: [kbd]pma__userconfig[/kbd]');
$strConfigServers_userconfig_name = __('User preferences storage table');
$strConfigServers_users_desc = __('Leave blank to disable configurable menus feature, suggested: [kbd]pma__users[/kbd]');
$strConfigServers_users_name = __('Users table');
$strConfigServers_usergroups_desc = __('Leave blank to disable configurable menus feature, suggested: [kbd]pma__usergroups[/kbd]');
$strConfigServers_usergroups_name = __('User groups table');
$strConfigServers_user_desc = __('Leave empty if not using config auth');
$strConfigServers_user_name = __('User for config auth');
$strConfigServers_verbose_desc = __('A user-friendly description of this server. Leave blank to display the hostname instead.');

View File

@ -70,6 +70,8 @@ $forms['Servers']['Server_pmadb'] = array('Servers' => array(1 => array(
'bookmarktable' => 'pma__bookmark',
'relation' => 'pma__relation',
'userconfig' => 'pma__userconfig',
'users' => 'pma__users',
'usergroups' => 'pma__usergroups',
'table_info' => 'pma__table_info',
'column_info' => 'pma__column_info',
'history' => 'pma__history',

View File

@ -377,6 +377,11 @@ function PMA_getSqlQueryAndCreateDbBeforeCopy()
$GLOBALS['dbi']->query($local_query);
$GLOBALS['db'] = $original_db;
// Set the SQL mode to NO_AUTO_VALUE_ON_ZERO to prevent MySQL from creating
// export statements it cannot import
$sql_set_mode = "SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'";
PMA_DBI_query($sql_set_mode);
// rebuild the database list because PMA_Table::moveCopy
// checks in this list if the target db exists
$GLOBALS['pma']->databases->build();

View File

@ -153,7 +153,9 @@ class AuthenticationConfig extends AuthenticationPlugin
echo '</tr>' . "\n";
}
echo '</table>' . "\n";
exit;
if (!defined('TESTSUITE')) {
exit;
}
return true;
}

View File

@ -102,7 +102,11 @@ class AuthenticationCookie extends AuthenticationPlugin
)
);
}
exit;
if (defined('TESTSUITE')) {
return true;
} else {
exit;
}
}
/* Perform logout to custom URL */
@ -110,7 +114,11 @@ class AuthenticationCookie extends AuthenticationPlugin
&& ! empty($GLOBALS['cfg']['Server']['LogoutURL'])
) {
PMA_sendHeaderLocation($GLOBALS['cfg']['Server']['LogoutURL']);
exit;
if (defined('TESTSUITE')) {
return true;
} else {
exit;
}
}
// No recall if blowfish secret is not configured as it would produce
@ -301,7 +309,11 @@ class AuthenticationCookie extends AuthenticationPlugin
if (file_exists(CUSTOM_FOOTER_FILE)) {
include CUSTOM_FOOTER_FILE;
}
exit;
if (! defined('TESTSUITE')) {
exit;
} else {
return true;
}
}
/**
@ -408,7 +420,9 @@ class AuthenticationCookie extends AuthenticationPlugin
// according to the PHP manual we should do this before the destroy:
//$_SESSION = array();
session_destroy();
if (! defined('TESTSUITE')) {
session_destroy();
}
// -> delete password cookie(s)
if ($GLOBALS['cfg']['LoginCookieDeleteAll']) {
foreach ($GLOBALS['cfg']['Servers'] as $key => $val) {
@ -478,7 +492,11 @@ class AuthenticationCookie extends AuthenticationPlugin
PMA_Util::cacheUnset('dbs_where_create_table_allowed', true);
$GLOBALS['no_activity'] = true;
$this->authFails();
exit;
if (! defined('TESTSUITE')) {
exit;
} else {
return false;
}
}
// password
@ -625,7 +643,11 @@ class AuthenticationCookie extends AuthenticationPlugin
$redirect_url . PMA_generate_common_url($url_params, '&'),
true
);
exit;
if (! defined('TESTSUITE')) {
exit;
} else {
return false;
}
} // end if
return true;

View File

@ -248,6 +248,23 @@ function PMA_getRelationsParamDiagnostic($cfgRelation)
'userconfigwork',
$messages
);
$retval .= PMA_getDiagMessageForParameter(
'users',
isset($cfgRelation['users']),
$messages,
'users'
);
$retval .= PMA_getDiagMessageForParameter(
'usergroups',
isset($cfgRelation['usergroups']),
$messages,
'usergroups'
);
$retval .= PMA_getDiagMessageForFeature(
__('Configurable menus'),
'menuswork',
$messages
);
$retval .= '</table>' . "\n";
$retval .= '<p>' . __('Quick steps to setup advanced features:') . '</p>';
@ -347,22 +364,23 @@ function PMA_getDiagMessageForParameter($parameter,
*/
function PMA_checkRelationsParam()
{
$cfgRelation = array();
$cfgRelation['relwork'] = false;
$cfgRelation['displaywork'] = false;
$cfgRelation['bookmarkwork']= false;
$cfgRelation['pdfwork'] = false;
$cfgRelation['commwork'] = false;
$cfgRelation['mimework'] = false;
$cfgRelation['historywork'] = false;
$cfgRelation['recentwork'] = false;
$cfgRelation['uiprefswork'] = false;
$cfgRelation['trackingwork'] = false;
$cfgRelation['designerwork'] = false;
$cfgRelation = array();
$cfgRelation['relwork'] = false;
$cfgRelation['displaywork'] = false;
$cfgRelation['bookmarkwork'] = false;
$cfgRelation['pdfwork'] = false;
$cfgRelation['commwork'] = false;
$cfgRelation['mimework'] = false;
$cfgRelation['historywork'] = false;
$cfgRelation['recentwork'] = false;
$cfgRelation['uiprefswork'] = false;
$cfgRelation['trackingwork'] = false;
$cfgRelation['designerwork'] = false;
$cfgRelation['userconfigwork'] = false;
$cfgRelation['allworks'] = false;
$cfgRelation['user'] = null;
$cfgRelation['db'] = null;
$cfgRelation['menuswork'] = false;
$cfgRelation['allworks'] = false;
$cfgRelation['user'] = null;
$cfgRelation['db'] = null;
if ($GLOBALS['server'] == 0
|| empty($GLOBALS['cfg']['Server']['pmadb'])
@ -408,21 +426,25 @@ function PMA_checkRelationsParam()
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['table_coords']) {
$cfgRelation['table_coords'] = $curr_table[0];
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['designer_coords']) {
$cfgRelation['designer_coords'] = $curr_table[0];
$cfgRelation['designer_coords'] = $curr_table[0];
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['column_info']) {
$cfgRelation['column_info'] = $curr_table[0];
$cfgRelation['column_info'] = $curr_table[0];
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['pdf_pages']) {
$cfgRelation['pdf_pages'] = $curr_table[0];
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['history']) {
$cfgRelation['history'] = $curr_table[0];
$cfgRelation['history'] = $curr_table[0];
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['recent']) {
$cfgRelation['recent'] = $curr_table[0];
$cfgRelation['recent'] = $curr_table[0];
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['table_uiprefs']) {
$cfgRelation['table_uiprefs'] = $curr_table[0];
$cfgRelation['table_uiprefs'] = $curr_table[0];
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['tracking']) {
$cfgRelation['tracking'] = $curr_table[0];
$cfgRelation['tracking'] = $curr_table[0];
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['userconfig']) {
$cfgRelation['userconfig'] = $curr_table[0];
$cfgRelation['userconfig'] = $curr_table[0];
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['users']) {
$cfgRelation['users'] = $curr_table[0];
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['usergroups']) {
$cfgRelation['usergroups'] = $curr_table[0];
}
} // end while
$GLOBALS['dbi']->freeResult($tab_rs);
@ -430,7 +452,7 @@ function PMA_checkRelationsParam()
if (isset($cfgRelation['relation'])) {
$cfgRelation['relwork'] = true;
if (isset($cfgRelation['table_info'])) {
$cfgRelation['displaywork'] = true;
$cfgRelation['displaywork'] = true;
}
}
@ -473,12 +495,17 @@ function PMA_checkRelationsParam()
$cfgRelation['bookmarkwork'] = true;
}
if (isset($cfgRelation['users']) && isset($cfgRelation['usergroups'])) {
$cfgRelation['menuswork'] = true;
}
if ($cfgRelation['relwork'] && $cfgRelation['displaywork']
&& $cfgRelation['pdfwork'] && $cfgRelation['commwork']
&& $cfgRelation['mimework'] && $cfgRelation['historywork']
&& $cfgRelation['recentwork'] && $cfgRelation['uiprefswork']
&& $cfgRelation['trackingwork'] && $cfgRelation['userconfigwork']
&& $cfgRelation['bookmarkwork'] && $cfgRelation['designerwork']
&& $cfgRelation['menuswork']
) {
$cfgRelation['allworks'] = true;
}

View File

@ -390,6 +390,103 @@ function PMA_getSqlQueryForDisplayPrivTable($db, $table, $username, $hostname)
." AND `Db` = '" . PMA_Util::unescapeMysqlWildcards($db) . "'"
." AND `Table_name` = '" . PMA_Util::sqlAddSlashes($table) . "';";
}
/**
* Displays a dropdown to select the user group
* with menu items configured to each of them.
*
* @param string $username username
*
* @return string html to select the user group
*/
function PMA_getHtmlToChoseUserGroup($username)
{
$html_output = '<form class="ajax" id="changeUserGroupForm"'
. ' action="server_privileges.php" method="post">';
$params = array('username' => $username);
$html_output .= PMA_generate_common_hidden_inputs($params);
$html_output .= '<fieldset id="fieldset_user_group_selection">';
$html_output .= '<legend>' . __('User group') . '</legend>';
$groupTable = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb'])
. "." . PMA_Util::backquote($GLOBALS['cfg']['Server']['usergroups']);
$userTable = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb'])
. "." . PMA_Util::backquote($GLOBALS['cfg']['Server']['users']);
$userGroups = array();
$sql_query = "SELECT `usergroup` FROM " . $groupTable;
$result = PMA_queryAsControlUser($sql_query, false);
if ($result) {
while ($row = $GLOBALS['dbi']->fetchRow($result)) {
$userGroups[] = $row[0];
}
}
$GLOBALS['dbi']->freeResult($result);
$userGroup = '';
if (isset($GLOBALS['username'])) {
$sql_query = "SELECT `usergroup` FROM " . $userTable
. " WHERE `username` = '" . PMA_Util::sqlAddSlashes($username) . "'";
$userGroup = $GLOBALS['dbi']->fetchValue(
$sql_query, 0, 0, $GLOBALS['controllink']
);
}
$html_output .= __('User group') . ': ';
$html_output .= '<select name="userGroup">';
$html_output .= '<option value=""></option>';
foreach ($userGroups as $oneUserGroup) {
$html_output .= '<option value="' . htmlspecialchars($oneUserGroup) . '"'
. ($oneUserGroup == $userGroup ? ' selected="selected"' : '')
. '>'
. htmlspecialchars($oneUserGroup)
. '</option>';
}
$html_output .= '</select>';
$html_output .= '<input type="hidden" name="changeUserGroup" value="1">';
$html_output .= '</fieldset>';
$html_output .= '</form>';
return $html_output;
}
/**
* Sets the user group from request values
*
* @param string $username username
* @param string $userGroup user group to set
*
* @return void
*/
function PMA_setUserGroup($username, $userGroup)
{
$userTable = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb'])
. "." . PMA_Util::backquote($GLOBALS['cfg']['Server']['users']);
$sql_query = "SELECT `usergroup` FROM " . $userTable
. " WHERE `username` = '" . PMA_Util::sqlAddSlashes($username) . "'";
$oldUserGroup = $GLOBALS['dbi']->fetchValue(
$sql_query, 0, 0, $GLOBALS['controllink']
);
if ($oldUserGroup === false) {
$upd_query = "INSERT INTO " . $userTable . "(`username`, `usergroup`)"
. " VALUES ('" . PMA_Util::sqlAddSlashes($username) . "', "
. "'" . PMA_Util::sqlAddSlashes($userGroup) . "')";
} else {
if (empty($userGroup)) {
$upd_query = "DELETE FROM " . $userTable
. " WHERE `username`='" . PMA_Util::sqlAddSlashes($username) . "'";
} elseif ($oldUserGroup != $userGroup) {
$upd_query = "UPDATE " . $userTable
. " SET `usergroup`='" . PMA_Util::sqlAddSlashes($userGroup) . "'"
. " WHERE `username`='" . PMA_Util::sqlAddSlashes($username) . "'";
}
}
if (isset($upd_query)) {
PMA_queryAsControlUser($upd_query);
}
}
/**
* Displays the privileges form table
*
@ -591,7 +688,7 @@ function PMA_getHtmlForDisplayResourceLimits($row)
* @param string $db the database
* @param string $table the table
* @param boolean $columns columns array
* @param $row current privileges row
* @param array $row current privileges row
*
* @return string $html_output
*/
@ -2429,9 +2526,12 @@ function PMA_getUsersOverview($result, $db_rights, $link_edit, $pmaThemeImage,
. PMA_Util::showHint(
__('Note: MySQL privilege names are expressed in English')
)
. '</th>' . "\n"
. '<th>' . __('Grant') . '</th>' . "\n"
. '<th colspan="2">' . __('Action') . '</th>' . "\n"
. '</th>' . "\n";
if ($GLOBALS['cfgRelation']['menuswork']) {
$html_output .= '<th>' . __('User group') . '</th>' . "\n";
}
$html_output .= '<th>' . __('Grant') . '</th>' . "\n"
. '<th colspan="3">' . __('Action') . '</th>' . "\n"
. '</tr>' . "\n"
. '</thead>' . "\n";
@ -2479,6 +2579,27 @@ function PMA_getUsersOverview($result, $db_rights, $link_edit, $pmaThemeImage,
*/
function PMA_getTableBodyForUserRightsTable($db_rights, $link_edit, $link_export)
{
if ($GLOBALS['cfgRelation']['menuswork']) {
$usersTable = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb'])
. "." . PMA_Util::backquote($GLOBALS['cfg']['Server']['users']);
$sqlQuery = "SELECT * FROM " . $usersTable;
$result = PMA_queryAsControlUser($sqlQuery, false);
$groupAssignment = array();
if ($result) {
while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
$groupAssignment[$row['username']] = $row['usergroup'];
}
}
$GLOBALS['dbi']->freeResult($result);
$link_edit_user_group = '<a class="edit_user_group_anchor ajax"'
. ' href="server_privileges.php?'
. str_replace('%', '%%', $GLOBALS['url_query'])
. '&amp;username=%s">'
. PMA_Util::getIcon('b_usrlist.png', __('Edit user group'))
. '</a>';
}
$odd_row = true;
$index_checkbox = 0;
$html_output = '';
@ -2521,28 +2642,48 @@ function PMA_getTableBodyForUserRightsTable($db_rights, $link_edit, $link_export
$html_output .= '<td><code>' . "\n"
. '' . implode(',' . "\n" . ' ', $host['privs']) . "\n"
. '</code></td>' . "\n"
. '<td>'
. '</code></td>' . "\n";
if ($GLOBALS['cfgRelation']['menuswork']) {
$html_output .= '<td class="usrGroup">' . "\n"
. (isset($groupAssignment[$host['User']])
? $groupAssignment[$host['User']]
: ''
)
. '</td>' . "\n";
}
$html_output .= '<td>'
. ($host['Grant_priv'] == 'Y' ? __('Yes') : __('No'))
. '</td>' . "\n"
. '<td class="center">'
. '</td>' . "\n";
$html_output .= '<td class="center">'
. sprintf(
$link_edit,
urlencode($host['User']),
urlencode($host['Host']),
'',
''
);
$html_output .= '</td>';
$html_output .= '<td class="center">';
$html_output .= sprintf(
$link_export,
urlencode($host['User']),
urlencode($host['Host']),
(isset($_GET['initial']) ? $_GET['initial'] : '')
);
$html_output .= '</td>';
)
. '</td>';
if ($GLOBALS['cfgRelation']['menuswork']) {
if (empty($host['User'])) {
$html_output .= '<td class="center"></td>';
} else {
$html_output .= '<td class="center">'
. sprintf(
$link_edit_user_group,
urlencode($host['User'])
)
. '</td>';
}
}
$html_output .= '<td class="center">'
. sprintf(
$link_export,
urlencode($host['User']),
urlencode($host['Host']),
(isset($_GET['initial']) ? $_GET['initial'] : '')
)
. '</td>';
$html_output .= '</tr>';
$odd_row = ! $odd_row;
}
@ -3028,8 +3169,324 @@ function PMA_getHtmlForDisplayUserOverviewPage($link_edit, $pmaThemeImage,
$flushnote->addParam('</a>', false);
$html_output .= $flushnote->getDisplay();
}
return $html_output;
}
return $html_output;
}
/**
* Return HTML to list the users belonging to a given user group
*
* @param string $userGroup user group name
*
* @return HTML to list the users belonging to a given user group
*/
function PMA_getHtmlForListingUsersofAGroup($userGroup)
{
$html_output = '<h2>'
. sprintf(__('Users of \'%s\' user group'), htmlspecialchars($userGroup))
. '</h2>';
$usersTable = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb'])
. "." . PMA_Util::backquote($GLOBALS['cfg']['Server']['users']);
$sql_query = "SELECT `username` FROM " . $usersTable
. " WHERE `usergroup`='" . PMA_Util::sqlAddSlashes($userGroup) . "'";
$result = PMA_queryAsControlUser($sql_query, false);
if ($result) {
if ($GLOBALS['dbi']->numRows($result) == 0) {
$html_output .= '<p>'
. __('No users were found belonging to this user group')
. '</p>';
} else {
$html_output .= '<table>'
. '<thead><tr><th>#</th><th>' . __('User') . '</th></tr></thead>'
. '<tbody>';
$i = 0;
while ($row = $GLOBALS['dbi']->fetchRow($result)) {
$i++;
$html_output .= '<tr>'
. '<td>' . $i . ' </td>'
. '<td>' . htmlspecialchars($row[0]) . '</td>'
. '</tr>';
}
$html_output .= '</tbody>'
. '</table>';
}
}
$GLOBALS['dbi']->freeResult($result);
return $html_output;
}
/**
* Returns HTML for the 'user groups' table
*
* @return string HTML for the 'user groups' table
*/
function PMA_getHtmlForUserGroupsTable()
{
$tabs = PMA_Util::getMenuTabList();
$html_output = '<h2>' . __('User groups') . '</h2>';
$html_output .= '<form name="userGroupsForm" id="userGroupsForm"'
. ' action="server_privileges.php" method="post">';
$html_output .= PMA_generate_common_hidden_inputs();
$html_output .= '<table id="userGroupsTable">';
$html_output .= '<thead><tr>';
$html_output .= '<th style="white-space: nowrap">' . __('User group') . '</th>';
$html_output .= '<th>' . __('Server level tabs') . '</th>';
$html_output .= '<th>' . __('Database level tabs') . '</th>';
$html_output .= '<th>' . __('Table level tabs') . '</th>';
$html_output .= '<th>' . __('Action') . '</th>';
$html_output .= '</tr></thead>';
$html_output .= '<tbody>';
$groupTable = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb'])
. "." . PMA_Util::backquote($GLOBALS['cfg']['Server']['usergroups']);
$sql_query = "SELECT * FROM " . $groupTable;
$result = PMA_queryAsControlUser($sql_query, false);
if ($result) {
$odd = true;
while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
$html_output .= '<tr class="' . ($odd ? 'odd' : 'even') . '">';
$html_output .= '<td>' . htmlspecialchars($row['usergroup']) . '</td>';
$html_output .= '<td>' . _getAllowedTabNames($row, 'server') . '</td>';
$html_output .= '<td>' . _getAllowedTabNames($row, 'db') . '</td>';
$html_output .= '<td>' . _getAllowedTabNames($row, 'table') . '</td>';
$html_output .= '<td>';
$html_output .= '<a class="" href="server_user_groups.php?'
. PMA_generate_common_url() . '&viewUsers=1&userGroup='
. urlencode($row['usergroup']) . '">'
. PMA_Util::getIcon('b_usrlist.png', __('View users')) . '</a>';
$html_output .= '&nbsp;&nbsp;';
$html_output .= '<a class="" href="server_user_groups.php?'
. PMA_generate_common_url() . '&editUserGroup=1&userGroup='
. urlencode($row['usergroup']) . '">'
. PMA_Util::getIcon('b_edit.png', __('Edit')) . '</a>';
$html_output .= '&nbsp;&nbsp;';
$html_output .= '<a class="" href="server_user_groups.php?'
. PMA_generate_common_url() . '&deleteUserGroup=1&userGroup='
. urlencode($row['usergroup']) . '">'
. PMA_Util::getIcon('b_drop.png', __('Delete')) . '</a>';
$html_output .= '</td>';
$html_output .= '</tr>';
$odd = ! $odd;
}
}
$GLOBALS['dbi']->freeResult($result);
$html_output .= '</tbody>';
$html_output .= '</table>';
$html_output .= '</form>';
$html_output .= '<fieldset id="fieldset_add_user_group">';
$html_output .= '<a href="server_user_groups.php?'
. PMA_generate_common_url() . '&addUserGroup=1">'
. PMA_Util::getIcon('b_usradd.png')
. __('Add user group') . '</a>';
$html_output .= '</fieldset>';
return $html_output;
}
/**
* Returns the list of allowed menu tab names
* based on a data row from usergroup table.
*
* @param array $row row of usergroup table
* @param string $level 'server', 'db' or 'table'
*
* @return string comma seperated list of allowed menu tab names
*/
function _getAllowedTabNames($row, $level)
{
$tabNames = array();
$tabs = PMA_Util::getMenuTabList($level);
foreach ($tabs as $tab => $tabName) {
if (! isset($row[$level . '_' . $tab])
|| $row[$level . '_' . $tab] == 'Y'
) {
$tabNames[] = $tabName;
}
}
return implode(', ', $tabNames);
}
/**
* Deletes a user group
*
* @param string $userGroup user group name
*
* @return void
*/
function PMA_deleteUserGroup($userGroup)
{
$groupTable = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb'])
. "." . PMA_Util::backquote($GLOBALS['cfg']['Server']['usergroups']);
$sql_query = "DELETE FROM " . $groupTable
. " WHERE `usergroup`='" . PMA_Util::sqlAddSlashes($userGroup) . "'";
PMA_queryAsControlUser($sql_query, true);
}
/**
* Returns HTML for add/edit user group dialog
*
* @param string $userGroup name of the user group in case of editing
*
* @return string HTML for add/edit user group dialog
*/
function PMA_getHtmlToEditUserGroup($userGroup = null)
{
$html_output = '';
if ($userGroup == null) {
$html_output .= '<h2>' . __('Add user group') . '</h2>';
} else {
$html_output .= '<h2>'
. sprintf(__('Edit user group: \'%s\''), htmlspecialchars($userGroup))
. '</h2>';
}
$html_output .= '<form name="userGroupForm" id="userGroupForm"'
. ' action="server_user_groups.php" method="post">';
$urlParams = array();
if ($userGroup != null) {
$urlParams['userGroup'] = $userGroup;
$urlParams['editUserGroupSubmit'] = '1';
} else {
$urlParams['addUserGroupSubmit'] = '1';
}
$html_output .= PMA_generate_common_hidden_inputs($urlParams);
$html_output .= '<fieldset id="fieldset_user_group_rights">';
$html_output .= '<legend>' . __('User group privileges')
. '&nbsp;&nbsp;&nbsp;'
. '<input type="checkbox" class="checkall_box" title="Check All">'
. '<label for="addUsersForm_checkall">' . __('Check All') .'</label>'
. '</legend>';
if ($userGroup == null) {
$html_output .= '<label for="userGroup">' . __('Group name: ') . '</label>';
$html_output .= '<input type="text" name="userGroup" autocomplete="off" />';
$html_output .= '<div class="clearfloat"></div>';
}
$allowedTabs = array(
'server' => array(),
'db' => array(),
'table' => array()
);
if ($userGroup != null) {
$groupTable = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb'])
. "." . PMA_Util::backquote($GLOBALS['cfg']['Server']['usergroups']);
$sql_query = "SELECT * FROM " . $groupTable
. " WHERE `usergroup`='" . PMA_Util::sqlAddSlashes($userGroup) . "'";
$result = PMA_queryAsControlUser($sql_query, false);
if ($result) {
$row = $GLOBALS['dbi']->fetchAssoc($result);
foreach ($row as $key => $value) {
if (substr($key, 0, 7) == 'server_' && $value == 'Y') {
$allowedTabs['server'][] = substr($key, 7);
} elseif (substr($key, 0, 3) == 'db_' && $value == 'Y') {
$allowedTabs['db'][] = substr($key, 3);
} elseif (substr($key, 0, 6) == 'table_' && $value == 'Y') {
$allowedTabs['table'][] = substr($key, 6);
}
}
}
$GLOBALS['dbi']->freeResult($result);
}
$html_output .= _getTabList(
__('Sever level tabs'), 'server', $allowedTabs['server']
);
$html_output .= _getTabList(
__('Database level tabs'), 'db', $allowedTabs['db']
);
$html_output .= _getTabList(
__('Table level tabs'), 'table', $allowedTabs['table']
);
$html_output .= '</fieldset>';
$html_output .= '<fieldset id="fieldset_user_group_rights_footer"'
. ' class="tblFooters">';
$html_output .= '<input type="submit" name="update_privs" value="Go">';
$html_output .= '</fieldset>';
return $html_output;
}
/**
* Returns HTML for checkbox groups to choose
* tabs of 'server', 'db' or 'table' levels.
*
* @param string $title title of the checkbox group
* @param string $level 'server', 'db' or 'table'
* @param array $selected array of selected allowed tabs
*
* @return string HTML for checkbox groups
*/
function _getTabList($title, $level, $selected)
{
$tabs = PMA_Util::getMenuTabList($level);
$html_output = '<fieldset>';
$html_output .= '<legend>' . $title . '</legend>';
foreach ($tabs as $tab => $tabName) {
$html_output .= '<div class="item">';
$html_output .= '<input type="checkbox" class="checkall"'
. (in_array($tab, $selected) ? 'checked="checked"' : '')
. ' name="' . $level . '_' . $tab . '" value="Y" />';
$html_output .= '<label for="' . $level . '_' . $tab . '">'
. '<code>' . $tabName . '</code>'
. '</label>';
$html_output .= '</div>';
}
$html_output .= '</fieldset>';
return $html_output;
}
/**
* Add/update a user group with allowed menu tabs.
*
* @param string $userGroup user group name
* @param boolean $new whether this is a new user group
*
* @return void
*/
function PMA_editUserGroup($userGroup, $new = false)
{
$tabs = PMA_Util::getMenuTabList();
$groupTable = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb'])
. "." . PMA_Util::backquote($GLOBALS['cfg']['Server']['usergroups']);
$cols = "";
$vals = "";
$colsNvals = "";
foreach ($tabs as $tabGroupName => $tabGroup) {
foreach ($tabs[$tabGroupName] as $tab => $tabName) {
$colName = $tabGroupName . '_' . $tab;
$cols .= "," . PMA_Util::backquote($colName);
if (isset($_REQUEST[$colName])&& $_REQUEST[$colName] == 'Y') {
$vals .= ",'Y'";
$colsNvals .= "," . PMA_Util::backquote($colName) . "='Y'";
} else {
$vals .= ",'N'";
$colsNvals .= "," . PMA_Util::backquote($colName) . "='N'";
}
}
}
if ($new) {
$sql_query = "INSERT INTO " . $groupTable
. "(`usergroup`" . $cols . ")"
. " VALUES"
. " ('" . PMA_Util::sqlAddSlashes($userGroup) . "'" . $vals . ")";
} else {
$sql_query = "UPDATE " . $groupTable . " SET " . substr($colsNvals, 1)
. " WHERE `usergroup`='" . PMA_Util::sqlAddSlashes($userGroup) . "'";
}
PMA_queryAsControlUser($sql_query, true);
}
/**
@ -3068,9 +3525,6 @@ function PMA_getHtmlForDisplayUserProperties($dbname_is_wildcard,$url_dbname,
}
$class = ' class="ajax"';
$html_output .= '<form' . $class . ' name="usersForm" id="addUsersForm"'
. ' action="server_privileges.php" method="post">' . "\n";
$_params = array(
'username' => $username,
'hostname' => $hostname,
@ -3081,8 +3535,10 @@ function PMA_getHtmlForDisplayUserProperties($dbname_is_wildcard,$url_dbname,
$_params['tablename'] = $tablename;
}
}
$html_output .= PMA_generate_common_hidden_inputs($_params);
$html_output .= '<form' . $class . ' name="usersForm" id="addUsersForm"'
. ' action="server_privileges.php" method="post">' . "\n";
$html_output .= PMA_generate_common_hidden_inputs($_params);
$html_output .= PMA_getHtmlToDisplayPrivilegesTable(
PMA_ifSetOr($dbname, '*', 'length'),
PMA_ifSetOr($tablename, '*', 'length')
@ -3402,4 +3858,44 @@ function PMA_getSqlQueriesForDisplayAndAddUser($username, $hostname, $password)
$sql_query
);
}
/**
* Get HTML for secondary level menu tabs on 'Users' page
*
* @param string $selfUrl Url of the file
*
* @return string HTML for secondary level menu tabs on 'Users' page
*/
function PMA_getHtmlForSubMenusOnUsersPage($selfUrl)
{
$url_params = PMA_generate_common_url();
$items = array(
array(
'name' => __('Users overview'),
'url' => 'server_privileges.php'
),
array(
'name' => __('User groups'),
'url' => 'server_user_groups.php'
)
);
$retval = '<ul id="topmenu2">';
foreach ($items as $item) {
$class = '';
if ($item['url'] === $selfUrl) {
$class = ' class="tabactive"';
}
$retval .= '<li>';
$retval .= '<a' . $class;
$retval .= ' href="' . $item['url'] . '?' . $url_params . '">';
$retval .= $item['name'];
$retval .= '</a>';
$retval .= '</li>';
}
$retval .= '</ul>';
$retval .= '<div class="clearfloat"></div>';
return $retval;
}
?>

View File

@ -0,0 +1,554 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* functions for displaying server status
*
* @usedby server_status.php
*
* @package PhpMyAdmin
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Prints server status information: processes, connections and traffic
*
* @param Object $ServerStatusData An instance of the PMA_ServerStatusData class
*
* @return string
*/
function PMA_getHtmlForServerStatus($ServerStatusData)
{
//display the server state General Information
$retval = PMA_getHtmlForServerStateGeneralInfo($ServerStatusData);
//display the server state traffic information
$retval .= PMA_getHtmlForServerStateTraffic($ServerStatusData);
//display the server state connection information
$retval .= PMA_getHtmlForServerStateConnections($ServerStatusData);
//display the server Process List information
$retval .= PMA_getHtmlForServerProcesslist($ServerStatusData);
return $retval;
}
/**
* Prints server state General information
*
* @param Object $ServerStatusData An instance of the PMA_ServerStatusData class
*
* @return string
*/
function PMA_getHtmlForServerStateGeneralInfo($ServerStatusData)
{
$start_time = $GLOBALS['dbi']->fetchValue(
'SELECT UNIX_TIMESTAMP() - ' . $ServerStatusData->status['Uptime']
);
$retval = '<h3>';
$bytes_received = $ServerStatusData->status['Bytes_received'];
$bytes_sent = $ServerStatusData->status['Bytes_sent'];
$retval .= sprintf(
__('Network traffic since startup: %s'),
implode(
' ',
PMA_Util::formatByteDown(
$bytes_received + $bytes_sent,
3,
1
)
)
);
$retval .= '</h3>';
$retval .= '<p>';
$retval .= sprintf(
__('This MySQL server has been running for %1$s. It started up on %2$s.'),
PMA_Util::timespanFormat($ServerStatusData->status['Uptime']),
PMA_Util::localisedDate($start_time)
) . "\n";
$retval .= '</p>';
if ($GLOBALS['server_master_status'] || $GLOBALS['server_slave_status']) {
$retval .= '<p class="notice">';
if ($GLOBALS['server_master_status'] && $GLOBALS['server_slave_status']) {
$retval .= __(
'This MySQL server works as <b>master</b> and '
. '<b>slave</b> in <b>replication</b> process.'
);
} elseif ($GLOBALS['server_master_status']) {
$retval .= __(
'This MySQL server works as <b>master</b> '
. 'in <b>replication</b> process.'
);
} elseif ($GLOBALS['server_slave_status']) {
$retval .= __(
'This MySQL server works as <b>slave</b> '
. 'in <b>replication</b> process.'
);
}
$retval .= '</p>';
}
/*
* if the server works as master or slave in replication process,
* display useful information
*/
if ($GLOBALS['server_master_status'] || $GLOBALS['server_slave_status']) {
$retval .= '<hr class="clearfloat" />';
$retval .= '<h3><a name="replication">';
$retval .= __('Replication status');
$retval .= '</a></h3>';
foreach ($GLOBALS['replication_types'] as $type) {
if (isset(${"server_{$type}_status"}) && ${"server_{$type}_status"}) {
$retval .= PMA_getHtmlForReplicationStatusTable($type);
}
}
}
return $retval;
}
/**
* Prints server state traffic information
*
* @param Object $ServerStatusData An instance of the PMA_ServerStatusData class
*
* @return string
*/
function PMA_getHtmlForServerStateTraffic($ServerStatusData)
{
$hour_factor = 3600 / $ServerStatusData->status['Uptime'];
$retval = '<table id="serverstatustraffic" class="data noclick">';
$retval .= '<thead>';
$retval .= '<tr>';
$retval .= '<th colspan="2">';
$retval .= __('Traffic') . '&nbsp;';
$retval .= PMA_Util::showHint(
__(
'On a busy server, the byte counters may overrun, so those statistics '
. 'as reported by the MySQL server may be incorrect.'
)
);
$retval .= '</th>';
$retval .= '<th>&oslash; ' . __('per hour') . '</th>';
$retval .= '</tr>';
$retval .= '</thead>';
$retval .= '<tbody>';
$retval .= '<tr class="odd">';
$retval .= '<th class="name">' . __('Received') . '</th>';
$retval .= '<td class="value">';
$retval .= implode(
' ',
PMA_Util::formatByteDown(
$ServerStatusData->status['Bytes_received'], 3, 1
)
);
$retval .= '</td>';
$retval .= '<td class="value">';
$retval .= implode(
' ',
PMA_Util::formatByteDown(
$ServerStatusData->status['Bytes_received'] * $hour_factor, 3, 1
)
);
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '<tr class="even">';
$retval .= '<th class="name">' . __('Sent') . '</th>';
$retval .= '<td class="value">';
$retval .= implode(
' ',
PMA_Util::formatByteDown(
$ServerStatusData->status['Bytes_sent'], 3, 1
)
);
$retval .= '</td>';
$retval .= '<td class="value"><?php echo';
$retval .= implode(
' ',
PMA_Util::formatByteDown(
$ServerStatusData->status['Bytes_sent'] * $hour_factor, 3, 1
)
);
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '<tr class="odd">';
$retval .= '<th class="name">' . __('Total') . '</th>';
$retval .= '<td class="value">';
$bytes_received = $ServerStatusData->status['Bytes_received'];
$bytes_sent = $ServerStatusData->status['Bytes_sent'];
$retval .= implode(
' ',
PMA_Util::formatByteDown(
$bytes_received + $bytes_sent, 3, 1
)
);
$retval .= '</td>';
$retval .= '<td class="value">';
$bytes_received = $ServerStatusData->status['Bytes_received'];
$bytes_sent = $ServerStatusData->status['Bytes_sent'];
$retval .= implode(
' ',
PMA_Util::formatByteDown(
($bytes_received + $bytes_sent) * $hour_factor, 3, 1
)
);
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '</tbody>';
$retval .= '</table>';
return $retval;
}
/**
* Prints server state connections information
*
* @param Object $ServerStatusData An instance of the PMA_ServerStatusData class
*
* @return string
*/
function PMA_getHtmlForServerStateConnections($ServerStatusData)
{
$hour_factor = 3600 / $ServerStatusData->status['Uptime'];
$retval = '<table id="serverstatusconnections" class="data noclick">';
$retval .= '<thead>';
$retval .= '<tr>';
$retval .= '<th colspan="2">' . __('Connections') . '</th>';
$retval .= '<th>&oslash; ' . __('per hour') . '</th>';
$retval .= '<th>%</th>';
$retval .= '</tr>';
$retval .= '</thead>';
$retval .= '<tbody>';
$retval .= '<tr class="odd">';
$retval .= '<th class="name">' . __('max. concurrent connections') . '</th>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Max_used_connections'], 0
);
$retval .= '</td>';
$retval .= '<td class="value">--- </td>';
$retval .= '<td class="value">--- </td>';
$retval .= '</tr>';
$retval .= '<tr class="even">';
$retval .= '<th class="name">' . __('Failed attempts') . '</th>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Aborted_connects'], 4, 1, true
);
$retval .= '</td>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Aborted_connects'] * $hour_factor, 4, 2, true
);
$retval .= '</td>';
$retval .= '<td class="value">';
if ($ServerStatusData->status['Connections'] > 0) {
$abortNum = $ServerStatusData->status['Aborted_connects'];
$connectNum = $ServerStatusData->status['Connections'];
$retval .= PMA_Util::formatNumber(
$abortNum * 100 / $connectNum,
0, 2, true
);
$retval .= '%';
} else {
$retval .= '--- ';
}
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '<tr class="odd">';
$retval .= '<th class="name">' . __('Aborted') . '</th>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Aborted_clients'], 4, 1, true
);
$retval .= '</td>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Aborted_clients'] * $hour_factor, 4, 2, true
);
$retval .= '</td>';
$retval .= '<td class="value">';
if ($ServerStatusData->status['Connections'] > 0) {
$abortNum = $ServerStatusData->status['Aborted_clients'];
$connectNum = $ServerStatusData->status['Connections'];
$retval .= PMA_Util::formatNumber(
$abortNum * 100 / $connectNum,
0, 2, true
);
$retval .= '%';
} else {
$retval .= '--- ';
}
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '<tr class="even">';
$retval .= '<th class="name">' . __('Total') . '</th>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Connections'], 4, 0
);
$retval .= '</td>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Connections'] * $hour_factor, 4, 2
);
$retval .= '</td>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(100, 0, 2);
$retval .= '%</td>';
$retval .= '</tr>';
$retval .= '</tbody>';
$retval .= '</table>';
return $retval;
}
/**
* Prints Server Process list
*
* @param Object $ServerStatusData An instance of the PMA_ServerStatusData class
*
* @return string
*/
function PMA_getHtmlForServerProcesslist($ServerStatusData)
{
$url_params = array();
$show_full_sql = ! empty($_REQUEST['full']);
if ($show_full_sql) {
$url_params['full'] = 1;
$full_text_link = 'server_status.php' . PMA_generate_common_url(
array(), 'html', '?'
);
} else {
$full_text_link = 'server_status.php' . PMA_generate_common_url(
array('full' => 1)
);
}
// This array contains display name and real column name of each
// sortable column in the table
$sortable_columns = array(
array(
'column_name' => __('ID'),
'order_by_field' => 'Id'
),
array(
'column_name' => __('User'),
'order_by_field' => 'User'
),
array(
'column_name' => __('Host'),
'order_by_field' => 'Host'
),
array(
'column_name' => __('Database'),
'order_by_field' => 'db'
),
array(
'column_name' => __('Command'),
'order_by_field' => 'Command'
),
array(
'column_name' => __('Time'),
'order_by_field' => 'Time'
),
array(
'column_name' => __('Status'),
'order_by_field' => 'State'
),
array(
'column_name' => __('SQL query'),
'order_by_field' => 'Info'
)
);
$sortable_columns_count = count($sortable_columns);
if (PMA_DRIZZLE) {
$left_str = 'left(p.info, '
. (int)$GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] . ')';
$sql_query = "SELECT
p.id AS Id,
p.username AS User,
p.host AS Host,
p.db AS db,
p.command AS Command,
p.time AS Time,
p.state AS State,"
. ($show_full_sql ? 's.query' : $left_str )
. " AS Info FROM data_dictionary.PROCESSLIST p "
. ($show_full_sql
? 'LEFT JOIN data_dictionary.SESSIONS s ON s.session_id = p.id'
: '');
if (! empty($_REQUEST['order_by_field'])
&& ! empty($_REQUEST['sort_order'])
) {
$sql_query .= ' ORDER BY p.' . $_REQUEST['order_by_field'] . ' '
. $_REQUEST['sort_order'];
}
} else {
$sql_query = $show_full_sql
? 'SHOW FULL PROCESSLIST'
: 'SHOW PROCESSLIST';
if (! empty($_REQUEST['order_by_field'])
&& ! empty($_REQUEST['sort_order'])
) {
$sql_query = 'SELECT * FROM `INFORMATION_SCHEMA`.`PROCESSLIST` '
. 'ORDER BY `'
. $_REQUEST['order_by_field'] . '` ' . $_REQUEST['sort_order'];
}
}
$result = $GLOBALS['dbi']->query($sql_query);
$retval = '<table id="tableprocesslist" '
. 'class="data clearfloat noclick sortable">';
$retval .= '<thead>';
$retval .= '<tr>';
$retval .= '<th>' . __('Processes') . '</th>';
foreach ($sortable_columns as $column) {
$is_sorted = ! empty($_REQUEST['order_by_field'])
&& ! empty($_REQUEST['sort_order'])
&& ($_REQUEST['order_by_field'] == $column['order_by_field']);
$column['sort_order'] = 'ASC';
if ($is_sorted && $_REQUEST['sort_order'] === 'ASC') {
$column['sort_order'] = 'DESC';
}
if ($is_sorted) {
if ($_REQUEST['sort_order'] == 'ASC') {
$asc_display_style = 'inline';
$desc_display_style = 'none';
} elseif ($_REQUEST['sort_order'] == 'DESC') {
$desc_display_style = 'inline';
$asc_display_style = 'none';
}
}
$retval .= '<th>';
$columnUrl = PMA_generate_common_url($column);
$retval .= '<a href="server_status.php' . $columnUrl . '" ';
if ($is_sorted) {
$retval .= 'onmouseout="$(\'.soimg\').toggle()" '
. 'onmouseover="$(\'.soimg\').toggle()"';
}
$retval .= '>';
$retval .= $column['column_name'];
if ($is_sorted) {
$retval .= '<img class="icon ic_s_desc soimg" alt="'
. __('Descending') . '" title="" src="themes/dot.gif" '
. 'style="display: ' . $desc_display_style . '" />';
$retval .= '<img class="icon ic_s_asc soimg hide" alt="'
. __('Ascending') . '" title="" src="themes/dot.gif" '
. 'style="display: ' . $asc_display_style . '" />';
}
$retval .= '</a>';
if (! PMA_DRIZZLE && (0 === --$sortable_columns_count)) {
$retval .= '<a href="' . $full_text_link . '">';
if ($show_full_sql) {
$retval .= PMA_Util::getImage(
's_partialtext.png',
__('Truncate Shown Queries')
);
} else {
$retval .= PMA_Util::getImage(
's_fulltext.png',
__('Show Full Queries')
);
}
$retval .= '</a>';
}
$retval .= '</th>';
}
$retval .= '</tr>';
$retval .= '</thead>';
$retval .= '<tbody>';
$odd_row = true;
while ($process = $GLOBALS['dbi']->fetchAssoc($result)) {
$retval .= PMA_getHtmlForServerProcessItem(
$process,
$odd_row,
$show_full_sql
);
$odd_row = ! $odd_row;
}
$retval .= '</tbody>';
$retval .= '</table>';
return $retval;
}
/**
* Prints Every Item of Server Process
*
* @param Array $process data of Every Item of Server Process
* @param bool $odd_row display odd row or not
* @param bool $show_full_sql show full sql or not
*
* @return string
*/
function PMA_getHtmlForServerProcessItem($process, $odd_row, $show_full_sql)
{
// Array keys need to modify due to the way it has used
// to display column values
if (! empty($_REQUEST['order_by_field']) && ! empty($_REQUEST['sort_order']) ) {
foreach (array_keys($process) as $key) {
$new_key = ucfirst(strtolower($key));
$process[$new_key] = $process[$key];
unset($process[$key]);
}
}
$url_params['kill'] = $process['Id'];
$kill_process = 'server_status.php' . PMA_generate_common_url($url_params);
$retval = '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
$retval .= '<td><a href="' . $kill_process . '">' . __('Kill') . '</a></td>';
$retval .= '<td class="value">' . $process['Id'] . '</td>';
$retval .= '<td>' . $process['User'] . '</td>';
$retval .= '<td>' . $process['Host'] . '</td>';
$retval .= '<td>' . ((! isset($process['db']) || ! strlen($process['db']))
? '<i>' . __('None') . '</i>'
: $process['db']) . '</td>';
$retval .= '<td>' . $process['Command'] . '</td>';
$retval .= '<td class="value">' . $process['Time'] . '</td>';
$processStatusStr = empty($process['State']) ? '---' : $process['State'];
$retval .= '<td>' . $processStatusStr . '</td>';
$retval .= '<td>';
if (empty($process['Info'])) {
$retval .= '---';
} else {
$cfg_maxDisplaySQL = $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'];
if (! $show_full_sql && strlen($process['Info']) > $cfg_maxDisplaySQL) {
$info = substr($process['Info'], 0, $cfg_maxDisplaySQL);
$retval .= htmlspecialchars($info) . '[...]';
} else {
$retval .= '<code class="sql"><pre>'
. $process['Info']
. '</pre></code>';
}
}
$retval .= '</td>';
$retval .= '</tr>';
return $retval;
}
?>

View File

@ -0,0 +1,70 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* functions for displaying server status sub item: advisor
*
* @usedby server_status_advisor.php
*
* @package PhpMyAdmin
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Returns html with Advisor
*
* @return string
*/
function PMA_getHtmlForAdvisor()
{
$output = '<a href="#openAdvisorInstructions">';
$output .= PMA_Util::getIcon('b_help.png', __('Instructions'));
$output .= '</a>';
$output .= '<div id="statustabs_advisor"></div>';
$output .= '<div id="advisorInstructionsDialog" style="display:none;">';
$output .= '<p>';
$output .= __(
'The Advisor system can provide recommendations '
. 'on server variables by analyzing the server status variables.'
);
$output .= '</p>';
$output .= '<p>';
$output .= __(
'Do note however that this system provides recommendations '
. 'based on simple calculations and by rule of thumb which may '
. 'not necessarily apply to your system.'
);
$output .= '</p>';
$output .= '<p>';
$output .= __(
'Prior to changing any of the configuration, be sure to know '
. 'what you are changing (by reading the documentation) and how '
. 'to undo the change. Wrong tuning can have a very negative '
. 'effect on performance.'
);
$output .= '</p>';
$output .= '<p>';
$output .= __(
'The best way to tune your system would be to change only one '
. 'setting at a time, observe or benchmark your database, and undo '
. 'the change if there was no clearly measurable improvement.'
);
$output .= '</p>';
$output .= '</div>';
$output .= '<div id="advisorData" style="display:none;">';
$advisor = new Advisor();
$output .= htmlspecialchars(
json_encode(
$advisor->run()
)
);
$output .= '</div>';
return $output;
}
?>

View File

@ -69,7 +69,6 @@ function PMA_getTableNameBySQL($sql, $tables)
* @param array $sql_data information about SQL statement
* @param string $goto URL to go back in case of errors
* @param string $pmaThemeImage path for theme images directory
* @param string $text_dir text direction
* @param string $printview whether printview is enabled
* @param string $url_query URL query
* @param array $disp_mode the display mode
@ -80,7 +79,7 @@ function PMA_getTableNameBySQL($sql, $tables)
*/
function PMA_getTableHtmlForMultipleQueries(
$displayResultsObject, $db, $sql_data, $goto, $pmaThemeImage,
$text_dir, $printview, $url_query, $disp_mode, $sql_limit_to_append,
$printview, $url_query, $disp_mode, $sql_limit_to_append,
$editable
) {
$table_html = '';
@ -187,8 +186,8 @@ function PMA_getTableHtmlForMultipleQueries(
$displayResultsObject->setProperties(
$unlim_num_rows, $fields_meta, $is_count, $is_export, $is_func,
$is_analyse, $num_rows, $fields_cnt, $querytime, $pmaThemeImage,
$text_dir, $is_maint, $is_explain, $is_show, $showtable,
$printview, $url_query, $editable
$GLOBALS['text_dir'], $is_maint, $is_explain, $is_show,
$showtable, $printview, $url_query, $editable
);
}
@ -1808,7 +1807,6 @@ function PMA_getBookmarkCreatedMessage()
* @param string $db current database
* @param string $goto goto page url
* @param string $pmaThemeImage theme image uri
* @param string $text_dir text directory
* @param string $url_query url query
* @param string $disp_mode display mode
* @param string $sql_limit_to_append sql limit to append
@ -1819,21 +1817,22 @@ function PMA_getBookmarkCreatedMessage()
* @param object $result result of the executed query
* @param int $querytime query execution time
* @param array $analyzed_sql_results analyzed sql results
* @param bool $is_procedure whether it is a procedure call or not
*
* @return type
*/
function PMA_getHtmlForSqlQueryResultsTable($sql_data, $displayResultsObject, $db,
$goto, $pmaThemeImage, $text_dir, $url_query, $disp_mode, $sql_limit_to_append,
$goto, $pmaThemeImage, $url_query, $disp_mode, $sql_limit_to_append,
$editable, $unlim_num_rows, $num_rows, $showtable, $result, $querytime,
$analyzed_sql_results, $is_procedure
$analyzed_sql_results
) {
$printview = isset($_REQUEST['printview']) ? $_REQUEST['printview'] : null;
if (! empty($sql_data) && ($sql_data['valid_queries'] > 1) || $is_procedure) {
if (! empty($sql_data) && ($sql_data['valid_queries'] > 1)
|| $analyzed_sql_results['is_procedure']
) {
$_SESSION['is_multi_query'] = true;
$table_html = PMA_getTableHtmlForMultipleQueries(
$displayResultsObject, $db, $sql_data, $goto,
$pmaThemeImage, $text_dir, $printview, $url_query,
$pmaThemeImage, $printview, $url_query,
$disp_mode, $sql_limit_to_append, $editable
);
} else {
@ -1846,7 +1845,7 @@ function PMA_getHtmlForSqlQueryResultsTable($sql_data, $displayResultsObject, $d
$unlim_num_rows, $fields_meta, $analyzed_sql_results['is_count'],
$analyzed_sql_results['is_export'], $analyzed_sql_results['is_func'],
$analyzed_sql_results['is_analyse'], $num_rows,
$fields_cnt, $querytime, $pmaThemeImage, $text_dir,
$fields_cnt, $querytime, $pmaThemeImage, $GLOBALS['text_dir'],
$analyzed_sql_results['is_maint'], $analyzed_sql_results['is_explain'],
$analyzed_sql_results['is_show'], $showtable, $printview, $url_query,
$editable
@ -1964,4 +1963,174 @@ function PMA_getHtmlForPrintButton()
return $print_button_html;
}
/**
* Function to display results when the executed query returns non empty results
*
* @param array $result executed query results
* @param bool $justBrowsing whether just browsing or not
* @param array $analyzed_sql_results analysed sql results
* @param string $db current database
* @param string $table current table
* @param string $disp_mode display mode
* @param string $message message to show
* @param array $sql_data sql data
* @param object $displayResultsObject Instance of DisplyResults.class
* @param string $goto goto page url
* @param string $pmaThemeImage uri of the theme image
* @param string $sql_limit_to_append sql limit to append
* @param int $unlim_num_rows unlimited number of rows
* @param int $num_rows number of rows
* @param int $querytime query time
* @param string $full_sql_query full sql query
* @param string $disp_query display query
* @param string $disp_message display message
* @param array $profiling_results profiling results
* @param string $query_type query type
* @param bool $selected selected
* @param string $sql_query sql query
* @param string $complete_query complete sql query
* @param array $cfg configuration
*
* @return void
*/
function PMA_sendResponseForResultsReturned($result, $justBrowsing,
$analyzed_sql_results, $db, $table, $disp_mode, $message, $sql_data,
$displayResultsObject, $goto, $pmaThemeImage, $sql_limit_to_append,
$unlim_num_rows, $num_rows, $querytime, $full_sql_query, $disp_query,
$disp_message, $profiling_results, $query_type, $selected, $sql_query,
$complete_query, $cfg
) {
// If we are retrieving the full value of a truncated field or the original
// value of a transformed field, show it here
if (isset($_REQUEST['grid_edit']) && $_REQUEST['grid_edit'] == true) {
PMA_sendResponseForGridEdit($result);
}
// Gets the list of fields properties
if (isset($result) && $result) {
$fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
}
// Should be initialized these parameters before parsing
$showtable = isset($showtable) ? $showtable : null;
$url_query = isset($url_query) ? $url_query : null;
$response = PMA_Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
// hide edit and delete links:
// - for information_schema
// - if the result set does not contain all the columns of a unique key
// and we are not just browing all the columns of an updatable view
$updatableView
= $justBrowsing
&& trim($analyzed_sql_results['analyzed_sql'][0]['select_expr_clause']) == '*'
&& PMA_Table::isUpdatableView($db, $table);
$has_unique = PMA_resultSetContainsUniqueKey(
$db, $table, $fields_meta
);
$editable = $has_unique || $updatableView;
// Displays the results in a table
if (empty($disp_mode)) {
// see the "PMA_setDisplayMode()" function in
// libraries/DisplayResults.class.php
$disp_mode = 'urdr111101';
}
if (!empty($table) && ($GLOBALS['dbi']->isSystemSchema($db) || !$editable)) {
$disp_mode = 'nnnn110111';
}
if ( isset($_REQUEST['printview']) && $_REQUEST['printview'] == '1') {
$disp_mode = 'nnnn000000';
}
if (isset($_REQUEST['table_maintenance'])) {
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
if (isset($message)) {
$message = PMA_Message::success($message);
$table_maintenance_html = PMA_Util::getMessage(
$message, $GLOBALS['sql_query'], 'success'
);
}
$table_maintenance_html .= PMA_getHtmlForSqlQueryResultsTable(
isset($sql_data) ? $sql_data : null, $displayResultsObject, $db, $goto,
$pmaThemeImage, $url_query, $disp_mode, $sql_limit_to_append,
false, $unlim_num_rows, $num_rows, $showtable, $result, $querytime,
$analyzed_sql_results, false
);
if (empty($sql_data) || ($sql_data['valid_queries'] = 1)) {
$response->addHTML($table_maintenance_html);
exit();
}
}
if (!isset($_REQUEST['printview']) || $_REQUEST['printview'] != '1') {
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
unset($message);
//we don't need to buffer the output in getMessage here.
//set a global variable and check against it in the function
$GLOBALS['buffer_message'] = false;
}
$print_view_header_html = PMA_getHtmlForPrintViewHeader(
$db, $full_sql_query, $num_rows
);
$previous_update_query_html = PMA_getHtmlForPreviousUpdateQuery(
isset($disp_query) ? $disp_query : null,
$cfg['ShowSQL'], isset($sql_data) ? $sql_data : null,
isset($disp_message) ? $disp_message : null
);
$profiling_chart_html = PMA_getHtmlForProfilingChart(
$disp_mode, $db, isset($profiling_results) ? $profiling_results : null
);
$missing_unique_column_msg = PMA_getMessageIfMissingColumnIndex(
$table, $db, $editable, $disp_mode
);
$bookmark_created_msg = PMA_getBookmarkCreatedMessage();
$table_html = PMA_getHtmlForSqlQueryResultsTable(
isset($sql_data) ? $sql_data : null, $displayResultsObject, $db, $goto,
$pmaThemeImage, $url_query, $disp_mode, $sql_limit_to_append,
$editable, $unlim_num_rows, $num_rows, $showtable, $result, $querytime,
$analyzed_sql_results
);
$indexes_problems_html = PMA_getHtmlForIndexesProblems(
isset($query_type) ? $query_type : null,
isset($selected) ? $selected : null
);
$bookmark_support_html = PMA_getHtmlForBookmark(
$disp_mode, isset($cfg['Bookmark']) ? $cfg['Bookmark'] : '', $sql_query,
$db, $table, isset($complete_query) ? $complete_query : $sql_query,
$cfg['Bookmark']['user']
);
$print_button_html = PMA_getHtmlForPrintButton();
$html_output = isset($table_maintenance_html) ? $table_maintenance_html : '';
$html_output .= isset($print_view_header_html) ? $print_view_header_html : '';
$html_output .= PMA_getHtmlForSqlQueryResults(
$previous_update_query_html, $profiling_chart_html,
$missing_unique_column_msg, $bookmark_created_msg,
$table_html, $indexes_problems_html, $bookmark_support_html,
$print_button_html
);
$response->addHTML($html_output);
exit();
}
?>

View File

@ -1667,7 +1667,7 @@ function PMA_SQP_analyze($arr)
$in_limit = false;
$after_limit = true;
// for the presnece of PROCEDURE ANALYSE
// for the presence of PROCEDURE ANALYSE
if (isset($subresult['queryflags']['select_from'])
&& $subresult['queryflags']['select_from'] == 1
&& ($i + 1) < $size
@ -1678,7 +1678,7 @@ function PMA_SQP_analyze($arr)
}
}
// for the presnece of INTO OUTFILE
// for the presence of INTO OUTFILE
if ($upper_data == 'INTO'
&& isset($subresult['queryflags']['select_from'])
&& $subresult['queryflags']['select_from'] == 1

View File

@ -271,10 +271,19 @@ class PMA_SysInfoLinux extends PMA_SysInfo
);
$mem = array_combine($matches[1], $matches[2]);
$memTotal = isset($mem['MemTotal']) ? $mem['MemTotal'] : 0;
$memFree = isset($mem['MemFree']) ? $mem['MemFree'] : 0;
$cached = isset($mem['Cached']) ? $mem['Cached'] : 0;
$buffers = isset($mem['Buffers']) ? $mem['Buffers'] : 0;
$swapTotal = isset($mem['SwapTotal']) ? $mem['SwapTotal'] : 0;
$swapFree = isset($mem['SwapFree']) ? $mem['SwapFree'] : 0;
$swapCached = isset($mem['SwapCached']) ? $mem['SwapCached'] : 0;
$mem['MemUsed']
= $mem['MemTotal'] - $mem['MemFree'] - $mem['Cached'] - $mem['Buffers'];
= $memTotal - $memFree - $cached - $buffers;
$mem['SwapUsed']
= $mem['SwapTotal'] - $mem['SwapFree'] - $mem['SwapCached'];
= $swapTotal - $swapFree - $swapCached;
foreach ($mem as $idx => $value) {
$mem[$idx] = intval($value);

View File

@ -4,17 +4,17 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2012-12-13 13:06+0200\n"
"PO-Revision-Date: 2013-07-15 11:30+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Belarusian <http://l10n.cihar.com/projects/phpmyadmin/master/"
"be/>\n"
"Language-Team: Belarusian "
"<http://l10n.cihar.com/projects/phpmyadmin/master/be/>\n"
"Language: be\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 1.4-dev\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 1.6-dev\n"
#: browse_foreigners.php:51 browse_foreigners.php:75 js/messages.php:339
#: libraries/DisplayResults.class.php:813
@ -3130,7 +3130,7 @@ msgstr "Першасны ключ быў выдалены"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Індэкс %s быў выдалены"
msgstr "Індэкс %s быў выдалены."
#: libraries/Index.class.php:731
#, php-format
@ -4092,7 +4092,7 @@ msgstr "тэчка вэб-сэрвэра для загрузкі файлаў"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Немагчыма адкрыць пазначаную вамі тэчку для загрузкі файлаў"
msgstr "Немагчыма адкрыць пазначаную вамі тэчку для загрузкі файлаў."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -8339,7 +8339,7 @@ msgstr ""
msgid "No activity within %s seconds; please log in again."
msgstr ""
"Не было аніякай актыўнасьці на працягу %s сэкундаў. Калі ласка, увайдзіце "
"зноў"
"зноў."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -8364,7 +8364,7 @@ msgstr "Файл %s ня ўтрымлівае ніякага ідэнтыфік
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Апаратная аўтэнтыфікацыя скончылася няўдала"
msgstr "Апаратная аўтэнтыфікацыя скончылася няўдала!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -11749,7 +11749,7 @@ msgid ""
msgstr ""
"Здаецца, ваш SQL-запыт утрымлівае памылку. Паведамленьне пра памылку сэрвэра "
"MySQL прыведзенае ніжэй, магчыма, таксама дапаможа вам высьветліць прычыну "
"памылкі"
"памылкі."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,10 +4,10 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-07-12 14:47+0200\n"
"PO-Revision-Date: 2013-07-15 11:14+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Bulgarian <http://l10n.cihar.com/projects/phpmyadmin/master/"
"bg/>\n"
"Language-Team: Bulgarian "
"<http://l10n.cihar.com/projects/phpmyadmin/master/bg/>\n"
"Language: bg\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -1683,7 +1683,7 @@ msgstr "Добавяне %d стойност(и)"
#: js/messages.php:259
msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr "Заб.: Ако файлът съдържа няколко таблици, те ще бъдат обединени"
msgstr "Заб.: Ако файлът съдържа няколко таблици, те ще бъдат обединени."
#: js/messages.php:262
msgid "Hide query box"
@ -2882,7 +2882,7 @@ msgstr "Главният ключ беше изтрит"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Индекс %s беше изтрит"
msgstr "Индекс %s беше изтрит."
#: libraries/Index.class.php:731
#, php-format
@ -3805,7 +3805,7 @@ msgstr "Избор от директорията за качване <b>%s</b>:"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Папката, която сте указали за качване е недостъпна"
msgstr "Папката, която сте указали за качване е недостъпна."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -7869,7 +7869,7 @@ msgstr "Входът без парола е забранен от конфигу
#: libraries/plugins/auth/AuthenticationSignon.class.php:254
#, php-format
msgid "No activity within %s seconds; please log in again."
msgstr "Няма активност през последните %s секунди; моля влезте отново"
msgstr "Няма активност през последните %s секунди; моля влезте отново."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -7893,7 +7893,7 @@ msgstr "Файлът %s не съдържа идентификатор на кл
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Неуспешно хардуерно удостоверяване"
msgstr "Неуспешно хардуерно удостоверяване!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -10958,7 +10958,7 @@ msgid ""
"below, if there is any, may also help you in diagnosing the problem."
msgstr ""
"Изглежда, че има грешка в SQL заявката ви. Грешката върната от MySQL сървъра "
"по долу, ако има такава, би могла да ви помогне в определянето на проблема"
"по долу, ако има такава, би могла да ви помогне в определянето на проблема."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -8,10 +8,9 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-07-12 15:45+0200\n"
"PO-Revision-Date: 2013-07-15 11:11+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Breton <http://l10n.cihar.com/projects/phpmyadmin/master/br/"
">\n"
"Language-Team: Breton <http://l10n.cihar.com/projects/phpmyadmin/master/br/>\n"
"Language: br\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -4195,7 +4194,8 @@ msgstr "%s d'ar muiañ"
#: libraries/config/FormDisplay.tpl.php:225
msgid "This setting is disabled, it will not be applied to your configuration."
msgstr ""
"Diweredekaet eo an arventenn; ne vo ket lakaet e pleustr gant ho kefluniadur."
"Diweredekaet eo an arventenn; ne vo ket lakaet e pleustr gant ho "
"kefluniadur."
#: libraries/config/FormDisplay.tpl.php:313
#, php-format
@ -7900,7 +7900,7 @@ msgstr "N'eus anaouder alc'hwez ebet er restr %s"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "C'hwitet eo bet dilesadur ar periant."
msgstr "C'hwitet eo bet dilesadur ar periant !"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"

View File

@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-07-09 13:12+0200\n"
"PO-Revision-Date: 2013-07-15 11:06+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Czech <http://l10n.cihar.com/projects/phpmyadmin/master/cs/>\n"
"Language: cs\n"
@ -1657,7 +1657,7 @@ msgstr "Přidat %d hodnot"
#: js/messages.php:259
msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr "Poznámka: Pokud soubor obsahuje více tabulek, budou sloučeny do jedné"
msgstr "Poznámka: Pokud soubor obsahuje více tabulek, budou sloučeny do jedné."
#: js/messages.php:262
msgid "Hide query box"
@ -2823,7 +2823,7 @@ msgstr "Primární klíč byl odstraněn"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Klíč %s byl odstraněn"
msgstr "Klíč %s byl odstraněn."
#: libraries/Index.class.php:731
#, php-format
@ -3778,7 +3778,7 @@ msgstr "Zvolte soubor z adresáře pro upload na serveru <b>%s</b>:"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Adresář určený pro upload souborů nemohl být otevřen"
msgstr "Adresář určený pro upload souborů nemohl být otevřen."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -7879,7 +7879,7 @@ msgstr "Přihlášení bez hesla je zakázáno v nastavení (viz AllowNoPassword
msgid "No activity within %s seconds; please log in again."
msgstr ""
"Nebyla zaznamenána žádná aktivita po dobu %s sekund, prosím přihlaste se "
"znovu"
"znovu."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -7903,7 +7903,7 @@ msgstr "Soubor %s neobsahuje ID klíče"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Hardwarové přihlašování selhala"
msgstr "Hardwarové přihlašování selhalo!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -11041,7 +11041,7 @@ msgid ""
"below, if there is any, may also help you in diagnosing the problem."
msgstr ""
"Pravděpodobně máte v SQL dotazu chybu. Níže uvedený výstup MySQL serveru "
"(pokud je nějaký) vám také může pomoci při zkoumání problému"
"(pokud je nějaký) vám také může pomoci při zkoumání problému."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,10 +4,9 @@ msgstr ""
"Project-Id-Version: phpMyAdmin-docs 4.0.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-06-19 12:38+0200\n"
"Last-Translator: Raimund Meyer <rm@km-it.de>\n"
"Language-Team: German <http://l10n.cihar.com/projects/phpmyadmin/master/de/"
">\n"
"PO-Revision-Date: 2013-07-15 11:31+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: German <http://l10n.cihar.com/projects/phpmyadmin/master/de/>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -1716,7 +1715,7 @@ msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr ""
"Hinweis: Wenn die Datei mehrere Tabellen enthält, werden diese in einer "
"einzigen Tabelle zusammengefasst"
"einzigen Tabelle zusammengefasst."
#: js/messages.php:262
msgid "Hide query box"
@ -2926,7 +2925,7 @@ msgstr "Der Primärschlüssel wurde gelöscht"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Index %s wurde entfernt"
msgstr "Index %s wurde entfernt."
#: libraries/Index.class.php:731
#, php-format
@ -3920,7 +3919,7 @@ msgstr "Wählen Sie vom Webserver-Uploadverzeichnis <b>%s</b>:"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Auf das festgelegte Upload-Verzeichnis kann nicht zugegriffen werden"
msgstr "Auf das festgelegte Upload-Verzeichnis kann nicht zugegriffen werden."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -8141,7 +8140,7 @@ msgstr ""
msgid "No activity within %s seconds; please log in again."
msgstr ""
"Da Sie seit mindestens %s Sekunden inaktiv waren, wurden Sie automatisch "
"abgemeldet. Bitte melden Sie sich erneut an"
"abgemeldet. Bitte melden Sie sich erneut an."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -8165,7 +8164,7 @@ msgstr "Die Datei %s enthält keine Schlüsselnummer"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Hardware Authentisierung fehlgeschlagen"
msgstr "Hardware Authentisierung fehlgeschlagen!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -11483,7 +11482,8 @@ msgid ""
"below, if there is any, may also help you in diagnosing the problem."
msgstr ""
"Es scheint einen Fehler in Ihrer MySQL-Abfrage zu geben. Die MySQL-"
"Fehlerausgabe, falls vorhanden, kann Ihnen auch bei der Fehleranalyse helfen"
"Fehlerausgabe, falls vorhanden, kann Ihnen auch bei der Fehleranalyse "
"helfen."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,7 +4,7 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-07-04 19:42+0200\n"
"PO-Revision-Date: 2013-07-15 07:46+0200\n"
"Last-Translator: Panagiotis Papazoglou <papaz_p@yahoo.com>\n"
"Language-Team: Greek <http://l10n.cihar.com/projects/phpmyadmin/master/el/>\n"
"Language: el\n"
@ -1672,7 +1672,7 @@ msgstr "Προσθήκη %d τιμής(ών)"
#: js/messages.php:259
msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr "Σημείωση: Αν το αρχείο περιέχει πολλούς πίνακες, θα ενωθουν σε έναν"
msgstr "Σημείωση: Αν το αρχείο περιέχει πολλούς πίνακες, θα ενωθουν σε έναν."
#: js/messages.php:262
msgid "Hide query box"
@ -2849,7 +2849,7 @@ msgstr "Το πρωτεύον κλειδί διεγράφη"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Το ευρετήριο %s διεγράφη"
msgstr "Το ευρετήριο %s έχει διαγραφεί."
#: libraries/Index.class.php:731
#, php-format
@ -3312,10 +3312,9 @@ msgid "Reset zoom"
msgstr "Επανφορά εστίασης"
#: libraries/TableSearch.class.php:1281
#, fuzzy
#| msgid "Replace with"
msgid "Replace with:"
msgstr "Αντικατάσταση με"
msgstr "Αντικατάσταση με:"
#: libraries/TableSearch.class.php:1341
msgid "Find and replace - preview"
@ -3827,8 +3826,7 @@ msgstr "Επιλογή από το φάκελο αποστολής του δια
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr ""
"Ο υποκατάλογος που ορίσατε για την αποθήκευση αρχείων δεν μπόρεσε να βρεθεί"
msgstr "Ο φάκελος που ορίσατε για την αποθήκευση αρχείων δεν μπόρεσε να βρεθεί."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -8014,7 +8012,7 @@ msgstr ""
msgid "No activity within %s seconds; please log in again."
msgstr ""
"Καμιά δραστηριότητα εδώ και %s δευτερόλεπτα τουλάχιστον, για αυτό "
"ξανασυνδεθείτε"
"ξανασυνδεθείτε."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -8038,7 +8036,7 @@ msgstr "Το αρχείο %s δεν περιέχει καμιά ταυτότητ
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Η επικύρωση του υλικού απέτυχε"
msgstr "Η επικύρωση του υλικού απέτυχε!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -11279,9 +11277,9 @@ msgid ""
"There seems to be an error in your SQL query. The MySQL server error output "
"below, if there is any, may also help you in diagnosing the problem."
msgstr ""
"Φαίνεται να υπάρχει ένα λάθος στο ερώτημά σας. Το παρακάτω λάθος διακομιστή "
"MySQL, εάν υπάρχει κάποιο, μπορεί επίσης να σας βοηθήσει να διαγνώσετε το "
"πρόβλημα"
"Φαίνεται να υπάρχει ένα λάθος στο ερώτημά SQL σας. Το παρακάτω λάθος "
"διακομιστή MySQL, εάν υπάρχει κάποιο, μπορεί επίσης να σας βοηθήσει να "
"διαγνώσετε το πρόβλημα."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,10 +4,10 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-07-12 14:44+0200\n"
"PO-Revision-Date: 2013-07-15 11:12+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Finnish <http://l10n.cihar.com/projects/phpmyadmin/master/fi/"
">\n"
"Language-Team: Finnish "
"<http://l10n.cihar.com/projects/phpmyadmin/master/fi/>\n"
"Language: fi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -1710,7 +1710,7 @@ msgstr "Lisää %d arvo(a)"
msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr ""
"Huom: Mikäli tiedostossa on useita tauluja, ne liitetään yhdeksi tauluksi"
"Huom: Mikäli tiedostossa on useita tauluja, ne liitetään yhdeksi tauluksi."
#: js/messages.php:262
msgid "Hide query box"
@ -2915,7 +2915,7 @@ msgstr "Perusavain on poistettu"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Indeksi %s on poistettu"
msgstr "Indeksi %s on poistettu."
#: libraries/Index.class.php:731
#, php-format
@ -3862,7 +3862,7 @@ msgstr "Valitse verkkopalvelimen lähetyskansiosta <b>%s</b>:"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Tiedostojen lähetykseen valittua hakemistoa ei voida käyttää"
msgstr "Tiedostojen lähetykseen valittua hakemistoa ei voida käyttää."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -8118,7 +8118,7 @@ msgstr "Tiedosto %s ei sisällä avaintunnusta"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Laitetodennus epäonnistui"
msgstr "Laitetodennus epäonnistui!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"

View File

@ -4,10 +4,10 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-07-12 14:54+0200\n"
"PO-Revision-Date: 2013-07-15 11:28+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Galician <http://l10n.cihar.com/projects/phpmyadmin/master/gl/"
">\n"
"Language-Team: Galician "
"<http://l10n.cihar.com/projects/phpmyadmin/master/gl/>\n"
"Language: gl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -1707,7 +1707,7 @@ msgstr "Engadir %d valor(es)"
#: js/messages.php:259
msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr "Nota: Se o ficheiro contén varias táboas, estas combínanse nunha"
msgstr "Nota: Se o ficheiro contén varias táboas, estas combínanse nunha."
#: js/messages.php:262
msgid "Hide query box"
@ -2902,7 +2902,7 @@ msgstr "Eliminouse a chave primaria"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Eliminouse o índice %s"
msgstr "Eliminouse o índice %s."
#: libraries/Index.class.php:731
#, php-format
@ -3898,7 +3898,7 @@ msgstr "Escoller o directorio de subida do servidor web <b>%s</b>:"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Non é posíbel acceder ao directorio que designou para os envíos"
msgstr "Non é posíbel acceder ao directorio que designou para os envíos."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -8157,7 +8157,7 @@ msgstr ""
msgid "No activity within %s seconds; please log in again."
msgstr ""
"Non se rexistrou actividade ningunha desde hai %s segundos ou máis. Terá que "
"entrar de novo"
"entrar de novo."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -8181,7 +8181,7 @@ msgstr "O ficheiro %s non contén ningún identificador de chave"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Fallou a autenticación do hardware"
msgstr "Fallou a autenticación do hardware!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -11441,7 +11441,7 @@ msgid ""
msgstr ""
"Parece que se produciu un erro na súa consulta de SQL. Se máis abaixo "
"aparece unha mensaxe de erro do servidor de MySQL, isto pode axudar a "
"diagnosticar o problema"
"diagnosticar o problema."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,10 +4,9 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-06-03 10:24+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Hebrew <http://l10n.cihar.com/projects/phpmyadmin/master/he/"
">\n"
"PO-Revision-Date: 2013-07-15 21:08+0200\n"
"Last-Translator: Bug Me Not <abcdefg@mailinator.com>\n"
"Language-Team: Hebrew <http://l10n.cihar.com/projects/phpmyadmin/master/he/>\n"
"Language: he\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -829,13 +828,14 @@ msgid ""
"Login cookie store is lower than cookie validity configured in phpMyAdmin, "
"because of this, your login will expire sooner than configured in phpMyAdmin."
msgstr ""
"חנות עוגיית כניסה נמוכה מתוקף עוגייה המוגדר בphpMyAdmin, בגלל זה, הכניסה שלך "
"תפוג מוקדם יותר מאשר מוגדרת בphpMyAdmin."
#: index.php:468
msgid "The configuration file now needs a secret passphrase (blowfish_secret)."
msgstr "קובץ התצורה צריכה ביטוי סיסמה סודית (blowfish_secret)."
#: index.php:479
#, fuzzy
#| msgid ""
#| "Directory [code]config[/code], which is used by the setup script, still "
#| "exists in your phpMyAdmin directory. You should remove it once phpMyAdmin "

View File

@ -4,16 +4,16 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-05-07 17:20+0200\n"
"PO-Revision-Date: 2013-07-15 11:29+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Croatian <http://l10n.cihar.com/projects/phpmyadmin/master/hr/"
">\n"
"Language-Team: Croatian "
"<http://l10n.cihar.com/projects/phpmyadmin/master/hr/>\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 1.6-dev\n"
#: browse_foreigners.php:51 browse_foreigners.php:75 js/messages.php:339
@ -3080,7 +3080,7 @@ msgstr "Primarni ključ je odbačen"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Index %s je odbačen"
msgstr "Index %s je odbačen."
#: libraries/Index.class.php:731
#, php-format
@ -4038,7 +4038,7 @@ msgstr "mapa učitavanja web poslužitelja"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Mapu koju ste odabrali za potrebe učitavanja nije moguće dohvatiti"
msgstr "Mapu koju ste odabrali za potrebe učitavanja nije moguće dohvatiti."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"

View File

@ -8,10 +8,9 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-05-07 17:20+0200\n"
"PO-Revision-Date: 2013-07-15 11:25+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Kazakh <http://l10n.cihar.com/projects/phpmyadmin/master/kk/"
">\n"
"Language-Team: Kazakh <http://l10n.cihar.com/projects/phpmyadmin/master/kk/>\n"
"Language: kk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -1407,7 +1406,7 @@ msgstr ""
#: js/messages.php:178
msgid "Sum of grouped rows:"
msgstr "Топтасқан қатарлар сомасы"
msgstr "Топтасқан қатарлар сомасы:"
#: js/messages.php:179
msgid "Total:"
@ -2356,7 +2355,7 @@ msgstr ""
#: libraries/DBQbe.class.php:1321
#, php-format
msgid "SQL query on database <b>%s</b>:"
msgstr "<b>%s</b> дерекқорына SQL сұранысы"
msgstr "<b>%s</b> дерекқорына SQL сұранысы:"
#: libraries/DBQbe.class.php:1335 libraries/Util.class.php:1286
msgid "Submit Query"
@ -2461,7 +2460,7 @@ msgstr "Кесте бойынша:"
#: libraries/DbSearch.class.php:445
msgid "Inside column:"
msgstr "Бағана бойынша"
msgstr "Бағана бойынша:"
#: libraries/DisplayResults.class.php:702
msgid "Save edited data"
@ -2809,7 +2808,7 @@ msgstr ""
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Индекс %s жойылған болатын"
msgstr "Индекс %s жойылған болатын."
#: libraries/Index.class.php:731
#, php-format
@ -7425,7 +7424,7 @@ msgstr ""
#: libraries/operations.lib.php:813
msgid "Table comments"
msgstr "Кестеге түсініктеме:"
msgstr "Кестеге түсініктеме"
#: libraries/operations.lib.php:822 libraries/server_engines.lib.php:49
msgid "Storage Engine"

View File

@ -4,16 +4,16 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-07-12 14:41+0200\n"
"PO-Revision-Date: 2013-07-15 11:14+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Lithuanian <http://l10n.cihar.com/projects/phpmyadmin/master/"
"lt/>\n"
"Language-Team: Lithuanian "
"<http://l10n.cihar.com/projects/phpmyadmin/master/lt/>\n"
"Language: lt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n"
"%100<10 || n%100>=20) ? 1 : 2;\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%"
"100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 1.6-dev\n"
#: browse_foreigners.php:51 browse_foreigners.php:75 js/messages.php:339
@ -1693,7 +1693,7 @@ msgstr "Pridėti %d reikšmę(-es)"
#: js/messages.php:259
msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr "Pastaba: Jei failas turi keletą lentelių jos bus sukombinuotos į vieną"
msgstr "Pastaba: Jei failas turi keletą lentelių jos bus sukombinuotos į vieną."
#: js/messages.php:262
msgid "Hide query box"
@ -2911,7 +2911,7 @@ msgstr "Panaikintas pirminis raktas"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Indeksas %s ištrintas"
msgstr "Indeksas %s ištrintas."
#: libraries/Index.class.php:731
#, php-format
@ -3856,7 +3856,7 @@ msgstr "Pasirinkti iš saityno serverio atsisiuntimų katalogą <b>%s</b>:"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Aplankas, kuris nurodytas įkeliamiems failams, nepasiekiamas"
msgstr "Aplankas, kuris nurodytas įkeliamiems failams, nepasiekiamas."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -8065,7 +8065,7 @@ msgstr ""
msgid "No activity within %s seconds; please log in again."
msgstr ""
"Daugiau nei %s sekundžių nebuvo atlikta jokių veiksmų, prašome prisijungti "
"iš naujo"
"iš naujo."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -8089,7 +8089,7 @@ msgstr "Failas %s neturi jokio raktinio id"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Aparatūros atpažinimas nepavyko"
msgstr "Aparatūros atpažinimas nepavyko!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -11230,7 +11230,7 @@ msgid ""
"below, if there is any, may also help you in diagnosing the problem."
msgstr ""
"Klaida SQL užklausoje. Žemiau išvestas MySQL serverio pranešimas (jeigu toks "
"yra), turėtų padėti Jums nustatyti klaidos priežastį"
"yra), turėtų padėti Jums nustatyti klaidos priežastį."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,10 +4,10 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-05-07 17:18+0200\n"
"PO-Revision-Date: 2013-07-15 11:30+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Latvian <http://l10n.cihar.com/projects/phpmyadmin/master/lv/"
">\n"
"Language-Team: Latvian "
"<http://l10n.cihar.com/projects/phpmyadmin/master/lv/>\n"
"Language: lv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -2975,7 +2975,7 @@ msgstr "Primārā atslēga tika izdzēsta"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Indekss %s tika izdzēsts"
msgstr "Indekss %s tika izdzēsts."
#: libraries/Index.class.php:731
#, php-format
@ -3921,7 +3921,7 @@ msgstr "web servera augšupielādes direktorija"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Direktoija, kuru norādijāt augšupielādei, nav pieejama"
msgstr "Direktoija, kuru norādijāt augšupielādei, nav pieejama."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -8038,7 +8038,8 @@ msgstr ""
#, php-format
msgid "No activity within %s seconds; please log in again."
msgstr ""
"Nebija aktivitātes vairāk kā %s sekunžu laikā, lūdzu autorizējieties vēlreiz"
"Nebija aktivitātes vairāk kā %s sekunžu laikā, lūdzu autorizējieties "
"vēlreiz."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -11264,7 +11265,7 @@ msgid ""
"below, if there is any, may also help you in diagnosing the problem."
msgstr ""
"Izkatās, ka Jūsu SQL vaicajumā ir kļūda. MySQL servera kļūdas pazinojums "
"zemāk, ja tāds ir, var arī palīdzet Jums diagnosticēt problēmu"
"zemāk, ja tāds ir, var arī palīdzet Jums diagnosticēt problēmu."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,10 +4,10 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-07-12 14:49+0200\n"
"PO-Revision-Date: 2013-07-15 11:14+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Norwegian Bokmål <http://l10n.cihar.com/projects/phpmyadmin/"
"master/nb/>\n"
"Language-Team: Norwegian Bokmål "
"<http://l10n.cihar.com/projects/phpmyadmin/master/nb/>\n"
"Language: nb\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -1701,7 +1701,7 @@ msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr ""
"Legg merke til: Om filen inneholder flere tabeller, så vil de kombineres til "
"en tabell"
"en tabell."
#: js/messages.php:262
msgid "Hide query box"
@ -2884,7 +2884,7 @@ msgstr "Primærnøkkelen har blitt slettet"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Indeksen %s har blitt slettet"
msgstr "Indeksen %s har blitt slettet."
#: libraries/Index.class.php:731
#, php-format
@ -3817,7 +3817,7 @@ msgstr "Merk fra opplastingskatalogen på vevtjeneren <b>%s</b>:"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Katalogen du anga for opplasting kan ikke nåes"
msgstr "Katalogen du anga for opplasting kan ikke nåes."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -8108,7 +8108,7 @@ msgstr ""
#: libraries/plugins/auth/AuthenticationSignon.class.php:254
#, php-format
msgid "No activity within %s seconds; please log in again."
msgstr "Ingen aktivitet på %s sekunder eller mer, du må logge inn på nytt"
msgstr "Ingen aktivitet på %s sekunder eller mer, du må logge inn på nytt."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -8132,7 +8132,7 @@ msgstr "Fila %s inneholder ingen nøkkel id"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Maskinvaregodkjenning mislyktes"
msgstr "Maskinvaregodkjenning mislyktes!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -11493,7 +11493,7 @@ msgid ""
msgstr ""
"Det ser ut til å være en feil i din SQL-spørring. En eventuell feilmelding "
"fra MySQL-tjeneren er skrevet ut nedenfor, og kan kanskje hjelpe deg med å "
"finne feilen"
"finne feilen."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,10 +4,9 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-05-30 13:29+0200\n"
"PO-Revision-Date: 2013-07-15 11:28+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Polish <http://l10n.cihar.com/projects/phpmyadmin/master/pl/"
">\n"
"Language-Team: Polish <http://l10n.cihar.com/projects/phpmyadmin/master/pl/>\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -1704,7 +1703,7 @@ msgstr "Dodaj %d wartość(i)"
#: js/messages.php:259
msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr "Uwaga: Jeśli plik zawiera wiele tabel, będzie połączony w jeden"
msgstr "Uwaga: Jeśli plik zawiera wiele tabel, będzie połączony w jeden."
#: js/messages.php:262
msgid "Hide query box"
@ -2899,7 +2898,7 @@ msgstr "Klucz podstawowy został usunięty"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Klucz %s został usunięty"
msgstr "Klucz %s został usunięty."
#: libraries/Index.class.php:731
#, php-format
@ -3889,7 +3888,7 @@ msgstr "Wybierz katalog serwera WWW dla uploadu <b>%s</b>:"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Nie można znaleźć katalogu do zapisu przesyłanych plików"
msgstr "Nie można znaleźć katalogu do zapisu przesyłanych plików."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -8117,7 +8116,8 @@ msgstr "Konfiguracja zabrania logowania bez hasła (zobacz AllowNoPassword)"
#, php-format
msgid "No activity within %s seconds; please log in again."
msgstr ""
"Brak aktywności przez co najmniej %s sekund, proszę zalogować się jeszcze raz"
"Brak aktywności przez co najmniej %s sekund, proszę zalogować się jeszcze "
"raz."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -8141,7 +8141,7 @@ msgstr "Plik %s nie zawiera żadnego identyfikatora klucza"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Uwierzytelnianie sprzętowe nie powiodło się"
msgstr "Uwierzytelnianie sprzętowe nie powiodło się!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -11387,7 +11387,7 @@ msgid ""
msgstr ""
"Wygląda na to, że w twoim zapytaniu SQL jest błąd. W znalezieniu przyczyny "
"problemu może pomóc także - jeśli się pojawi - poniższy opis błędu serwera "
"MySQL"
"MySQL."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,10 +4,10 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-07-12 14:48+0200\n"
"PO-Revision-Date: 2013-07-15 11:13+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Portuguese <http://l10n.cihar.com/projects/phpmyadmin/master/"
"pt/>\n"
"Language-Team: Portuguese "
"<http://l10n.cihar.com/projects/phpmyadmin/master/pt/>\n"
"Language: pt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -1691,7 +1691,7 @@ msgstr "Add %d valor(es)"
#: js/messages.php:259
msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr "Nota: Se o arquivo contém várias tabelas, estas serão combinadas numa"
msgstr "Nota: Se o arquivo contém várias tabelas, estas serão combinadas numa."
#: js/messages.php:262
msgid "Hide query box"
@ -2884,7 +2884,7 @@ msgstr "A chave primária foi eliminada"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "O Índice %s foi eliminado"
msgstr "O Índice %s foi eliminado."
#: libraries/Index.class.php:731
#, php-format
@ -3843,7 +3843,7 @@ msgstr "Selecionar a partir da directoria de upload do servidor <b>%s</b>:"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Não é possivel alcançar a directoria que configurou para fazer upload"
msgstr "Não é possivel alcançar a directoria que configurou para fazer upload."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -8107,7 +8107,7 @@ msgstr ""
#, php-format
msgid "No activity within %s seconds; please log in again."
msgstr ""
"Sem actividade há %s segundos ou mais; Por favor, faça o login novamente"
"Sem actividade há %s segundos ou mais; Por favor, faça o login novamente."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -8131,7 +8131,7 @@ msgstr "Arquivo %s não contém qualquer identificação de chave"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Falha na autenticação de hardware"
msgstr "Falha na autenticação de hardware!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -11263,7 +11263,7 @@ msgid ""
msgstr ""
"Parece haver um erro na sua consulta SQL. A mensagem de erro do servidor "
"MySQL abaixo, isto se existir alguma, também o poderá ajudar a diagnosticar "
"o problema"
"o problema."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,10 +4,10 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-07-12 14:41+0200\n"
"PO-Revision-Date: 2013-07-15 11:14+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Romanian <http://l10n.cihar.com/projects/phpmyadmin/master/ro/"
">\n"
"Language-Team: Romanian "
"<http://l10n.cihar.com/projects/phpmyadmin/master/ro/>\n"
"Language: ro\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -1774,7 +1774,7 @@ msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr ""
"Notă: Dacă fișierul conține mai multe tabele, acestea vor fi combinate într-"
"unul singur"
"unul singur."
#: js/messages.php:262
msgid "Hide query box"
@ -3038,7 +3038,7 @@ msgstr "Cheia primară a fost aruncată"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Indexul %s a fost aruncat"
msgstr "Indexul %s a fost aruncat."
#: libraries/Index.class.php:731
#, php-format
@ -3994,7 +3994,7 @@ msgstr "director de încărcare al serverului Web"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Directorul stabilit pentru încărcare nu poate fi găsit"
msgstr "Directorul stabilit pentru încărcare nu poate fi găsit."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -8468,7 +8468,7 @@ msgstr ""
msgid "No activity within %s seconds; please log in again."
msgstr ""
"Nu ați avut activitate de mai mult de %s secunde, vă rugăm să vă "
"autentificați din nou"
"autentificați din nou."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -8493,7 +8493,7 @@ msgstr ""
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Autentificarea hardware a eșuat"
msgstr "Autentificarea hardware a eșuat!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -11762,7 +11762,7 @@ msgid ""
"below, if there is any, may also help you in diagnosing the problem."
msgstr ""
"Pare sa fie o eroare in comanda SQL. Eroarea MySQL de mai jos, daca e "
"vreuna, poate sa te ajute la diagnosticarea problemei"
"vreuna, poate sa te ajute la diagnosticarea problemei."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,16 +4,16 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-05-11 21:28+0200\n"
"Last-Translator: Victor Volkov <hanut@php-myadmin.ru>\n"
"Language-Team: Russian <http://l10n.cihar.com/projects/phpmyadmin/master/ru/"
">\n"
"PO-Revision-Date: 2013-07-15 11:29+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Russian "
"<http://l10n.cihar.com/projects/phpmyadmin/master/ru/>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 1.6-dev\n"
#: browse_foreigners.php:51 browse_foreigners.php:75 js/messages.php:339
@ -1671,7 +1671,7 @@ msgstr "Добавить %d значение(й)"
msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr ""
"Замечание: если файл содержит множество таблиц, они будут объединены в одну"
"Замечание: если файл содержит множество таблиц, они будут объединены в одну."
#: js/messages.php:262
msgid "Hide query box"
@ -2236,17 +2236,17 @@ msgstr "PHP вернул следующую ошибку: %s"
#: libraries/Advisor.class.php:107
#, php-format
msgid "Failed evaluating precondition for rule '%s'."
msgstr "Не удалось определить условия для правила '%s'"
msgstr "Не удалось определить условия для правила '%s'."
#: libraries/Advisor.class.php:124
#, php-format
msgid "Failed calculating value for rule '%s'."
msgstr "Не удалось подсчитать значение для правила '%s'"
msgstr "Не удалось подсчитать значение для правила '%s'."
#: libraries/Advisor.class.php:143
#, php-format
msgid "Failed running test for rule '%s'."
msgstr "Не удалось запустить проверку правила '%s'"
msgstr "Не удалось запустить проверку правила '%s'."
#: libraries/Advisor.class.php:225
#, php-format
@ -2259,17 +2259,17 @@ msgid ""
"Invalid rule declaration on line %1$s, expected line %2$s of previous rule."
msgstr ""
"Неверное определение правила на строке %1$s, ожидается строка %2$s "
"предыдущего правила"
"предыдущего правила."
#: libraries/Advisor.class.php:412
#, php-format
msgid "Invalid rule declaration on line %s."
msgstr "Неверное определение правила на строке %s"
msgstr "Неверное определение правила на строке %s."
#: libraries/Advisor.class.php:420
#, php-format
msgid "Unexpected characters on line %s."
msgstr "Неожиданные символы на строке %s"
msgstr "Неожиданные символы на строке %s."
#: libraries/Advisor.class.php:434
#, fuzzy, php-format
@ -2856,7 +2856,7 @@ msgstr "Первичный ключ был удален"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Индекс %s был удален"
msgstr "Индекс %s был удален."
#: libraries/Index.class.php:731
#, php-format
@ -3840,7 +3840,7 @@ msgstr "Выберите из каталога загрузки сервера <
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Установленный каталог загрузки не доступен"
msgstr "Установленный каталог загрузки не доступен."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -4171,7 +4171,7 @@ msgstr "максимум %s"
#: libraries/config/FormDisplay.tpl.php:225
msgid "This setting is disabled, it will not be applied to your configuration."
msgstr "Эта настройка отключена и не будет применена при конфигурации"
msgstr "Эта настройка отключена и не будет применена при конфигурации."
#: libraries/config/FormDisplay.tpl.php:313
#, php-format
@ -8020,7 +8020,7 @@ msgstr "Вход без пароля запрещен при конфигура
#, php-format
msgid "No activity within %s seconds; please log in again."
msgstr ""
"Отсутствие активности более %s секунд, пожалуйста, авторизуйтесь заново"
"Отсутствие активности более %s секунд, пожалуйста, авторизуйтесь заново."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -8044,7 +8044,7 @@ msgstr "Файл %s не содержит ключа идентификации"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Ошибка аппаратной идентификации"
msgstr "Ошибка аппаратной идентификации!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -8843,8 +8843,8 @@ msgid ""
"master."
msgstr ""
"Сразу после перезапуска MySQL сервера, пожалуйста, нажмите кнопку OK, после "
"чего вы должны увидеть сообщение указывающее, что данный сервер <b>настроен</"
"b> как головной"
"чего вы должны увидеть сообщение указывающее, что данный сервер "
"<b>настроен</b> как головной."
#: libraries/replication_gui.lib.php:139
#: libraries/server_databases.lib.php:395

View File

@ -4,10 +4,9 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-06-11 16:36+0200\n"
"Last-Translator: Peter Rosa <peter.rosa@pro.sk>\n"
"Language-Team: Slovak <http://l10n.cihar.com/projects/phpmyadmin/master/sk/"
">\n"
"PO-Revision-Date: 2013-07-15 11:31+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Slovak <http://l10n.cihar.com/projects/phpmyadmin/master/sk/>\n"
"Language: sk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -1705,7 +1704,7 @@ msgstr "Pridať %d hodnôt"
msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr ""
"Poznámka: Ak súbor obsahuje viac tabuliek, tieto budú spojené do jednej"
"Poznámka: Ak súbor obsahuje viac tabuliek, tieto budú spojené do jednej."
#: js/messages.php:262
msgid "Hide query box"
@ -2885,7 +2884,7 @@ msgstr "Primárny kľúč bol zrušený"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Index pre %s bol odstránený"
msgstr "Index pre %s bol odstránený."
#: libraries/Index.class.php:731
#, php-format
@ -3868,7 +3867,7 @@ msgstr "Zvoľte súbor z upload adresára <b>%s</b> web servera:"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Adresár určený pre upload súborov sa nedá otvoriť"
msgstr "Adresár určený pre upload súborov sa nedá otvoriť."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -8009,7 +8008,7 @@ msgstr ""
#: libraries/plugins/auth/AuthenticationSignon.class.php:254
#, php-format
msgid "No activity within %s seconds; please log in again."
msgstr "Boli ste neaktívni viac ako %s sekúnd, prihláste sa prosím znovu"
msgstr "Boli ste neaktívni viac ako %s sekúnd, prihláste sa prosím znovu."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -8033,7 +8032,7 @@ msgstr "Súbor %s neobsahuje ID kľúč"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Hardwarové prihlasovanie zlyhalo"
msgstr "Hardwarové prihlasovanie zlyhalo!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -11165,7 +11164,7 @@ msgid ""
"below, if there is any, may also help you in diagnosing the problem."
msgstr ""
"Vyskytla sa chyba v SQL dopyte. Nižšie uvedený MySQL výstup (ak je nejaký) "
"Vám môže pomôcť odstrániť problém"
"Vám môže pomôcť odstrániť problém."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,16 +4,16 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-07-12 14:41+0200\n"
"PO-Revision-Date: 2013-07-15 11:13+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Serbian (latin) <http://l10n.cihar.com/projects/phpmyadmin/"
"master/sr@latin/>\n"
"Language-Team: Serbian (latin) "
"<http://l10n.cihar.com/projects/phpmyadmin/master/sr@latin/>\n"
"Language: sr@latin\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 1.6-dev\n"
#: browse_foreigners.php:51 browse_foreigners.php:75 js/messages.php:339
@ -1690,7 +1690,7 @@ msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr ""
"Imajte u vidu: Ako datoteka sadrži više tabela, one će biti kombinovane u "
"jednu"
"jednu."
#: js/messages.php:262
msgid "Hide query box"
@ -2897,7 +2897,7 @@ msgstr "Primarni ključ je obrisan"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Indeks %s je obrisan"
msgstr "Indeks %s je obrisan."
#: libraries/Index.class.php:731
#, php-format
@ -3834,7 +3834,7 @@ msgstr ""
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Direktorijum koji ste izabrali za slanje nije dostupan"
msgstr "Direktorijum koji ste izabrali za slanje nije dostupan."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -7909,7 +7909,7 @@ msgstr ""
#: libraries/plugins/auth/AuthenticationSignon.class.php:254
#, php-format
msgid "No activity within %s seconds; please log in again."
msgstr "Nije bilo aktivnosti %s ili više sekundi, molimo prijavite se ponovo"
msgstr "Nije bilo aktivnosti %s ili više sekundi, molimo prijavite se ponovo."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -7933,7 +7933,7 @@ msgstr "Datoteka %s ne sadrži ni jedan identifikator ključa"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Hardverska autentikacija nije uspela"
msgstr "Hardverska autentikacija nije uspela!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -11077,7 +11077,7 @@ msgid ""
"below, if there is any, may also help you in diagnosing the problem."
msgstr ""
"Izgleda da postoji greška u vašem SQL upitu. Ovde je poruka o greški MySQL "
"servera, koja vam može pomoći u otkrivanju problema"
"servera, koja vam može pomoći u otkrivanju problema."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,16 +4,16 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-07-12 14:49+0200\n"
"PO-Revision-Date: 2013-07-15 11:14+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Ukrainian <http://l10n.cihar.com/projects/phpmyadmin/master/"
"uk/>\n"
"Language-Team: Ukrainian "
"<http://l10n.cihar.com/projects/phpmyadmin/master/uk/>\n"
"Language: uk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 1.6-dev\n"
#: browse_foreigners.php:51 browse_foreigners.php:75 js/messages.php:339
@ -1703,7 +1703,7 @@ msgstr "Додати %d значення(ь)"
msgid ""
"Note: If the file contains multiple tables, they will be combined into one."
msgstr ""
"Примітка: Якщо файл містить кілька таблиць, то вони будуть об'єднані в одну"
"Примітка: Якщо файл містить кілька таблиць, то вони будуть об'єднані в одну."
#: js/messages.php:262
msgid "Hide query box"
@ -2897,7 +2897,7 @@ msgstr "Первинний ключ було знищено"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "Індекс %s було знищено"
msgstr "Індекс %s було знищено."
#: libraries/Index.class.php:731
#, php-format
@ -3834,7 +3834,7 @@ msgstr "Виберіть з каталога веб-сервера для від
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Встановлений Вами каталог для завантаження файлів недоступний"
msgstr "Встановлений Вами каталог для завантаження файлів недоступний."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -8085,7 +8085,7 @@ msgstr "Авторизація без паролю заборонена в на
#: libraries/plugins/auth/AuthenticationSignon.class.php:254
#, php-format
msgid "No activity within %s seconds; please log in again."
msgstr "Відсутня діяльність протягом %s секунд; будь ласка, увійдіть знову"
msgstr "Відсутня діяльність протягом %s секунд; будь ласка, увійдіть знову."
#: libraries/plugins/auth/AuthenticationCookie.class.php:667
#: libraries/plugins/auth/AuthenticationCookie.class.php:669
@ -8110,7 +8110,7 @@ msgstr "Файл %s не містить ідентифікатора (id) клю
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:176
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:196
msgid "Hardware authentication failed!"
msgstr "Апаратна аутентифікація не вдалася"
msgstr "Апаратна аутентифікація не вдалася!"
#: libraries/plugins/auth/swekey/swekey.auth.lib.php:183
msgid "No valid authentication key plugged"
@ -11381,7 +11381,7 @@ msgid ""
"below, if there is any, may also help you in diagnosing the problem."
msgstr ""
"Схоже на помилку у SQL запиті. У визначенні проблеми може допомогти "
"повідомлення про помилку сервера MySQL, що наведено нижче (якщо таке є)"
"повідомлення про помилку сервера MySQL, що наведено нижче (якщо таке є)."
#: libraries/sqlparser.lib.php:178
msgid ""

View File

@ -4,10 +4,10 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.1-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-07-12 16:06+0200\n"
"PO-Revision-Date: 2013-05-07 17:31+0200\n"
"PO-Revision-Date: 2013-07-15 11:32+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Uzbek (latin) <http://l10n.cihar.com/projects/phpmyadmin/"
"master/uz@latin/>\n"
"Language-Team: Uzbek (latin) "
"<http://l10n.cihar.com/projects/phpmyadmin/master/uz@latin/>\n"
"Language: uz@latin\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -1914,7 +1914,7 @@ msgstr "Maksimum bajarilish vaqti"
#: libraries/DisplayResults.class.php:733
#, php-format
msgid "%d is not valid row number."
msgstr "%d soni togri qator raqami emas!"
msgstr "%d soni togri qator raqami emas."
#: js/messages.php:271 libraries/display_indexes.lib.php:195
#: libraries/insert_edit.lib.php:1462
@ -3089,7 +3089,7 @@ msgstr ""
msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini."
msgstr ""
"Yuklanayotgan fayl hajmi PHP konfiguratsion faylida (php.ini) korsatilgan "
"\"upload_max_filesize\" direktivasi qiymatidan katta!"
"\"upload_max_filesize\" direktivasi qiymatidan katta."
#: libraries/File.class.php:282
msgid ""
@ -3097,7 +3097,7 @@ msgid ""
"the HTML form."
msgstr ""
"Yuklanayotgan fayl hajmi HTML formada korsatilgan \"MAX_FILE_SIZE\" "
"direktivasi qiymatidan katta!"
"direktivasi qiymatidan katta."
#: libraries/File.class.php:285
msgid "The uploaded file was only partially uploaded."
@ -3198,7 +3198,7 @@ msgstr "Birlamchi kalit ochirildi"
#: libraries/Index.class.php:608
#, php-format
msgid "Index %s has been dropped."
msgstr "\"%s\" indeksi ochirildi"
msgstr "\"%s\" indeksi ochirildi."
#: libraries/Index.class.php:731
#, php-format
@ -4170,7 +4170,7 @@ msgstr "Yuklash katalogidan"
#: libraries/Util.class.php:3441 libraries/insert_edit.lib.php:1183
#: libraries/sql_query_form.lib.php:483
msgid "The directory you set for upload work cannot be reached."
msgstr "Korsatilgan katalokka yuklab bolmadi"
msgstr "Korsatilgan katalokka yuklab bolmadi."
#: libraries/Util.class.php:3452
msgid "There are no files to upload"
@ -10668,12 +10668,12 @@ msgstr "Ma`lumotlar bazalarini va jadvallarni ochirishga ruxsat beradi."
msgid "Allows reloading server settings and flushing the server's caches."
msgstr ""
"Server sozlanishlarini qayta yuklashga va uning keshlarini tozalashga ruxsat "
"beradi"
"beradi."
#: libraries/server_privileges.lib.php:202
#: libraries/server_privileges.lib.php:960 server_privileges.php:90
msgid "Allows shutting down the server."
msgstr "Server ishini yakunlashga ruxsat beradi"
msgstr "Server ishini yakunlashga ruxsat beradi."
#: libraries/server_privileges.lib.php:207
#: libraries/server_privileges.lib.php:952 server_privileges.php:82
@ -10683,7 +10683,7 @@ msgstr "Barcha foydalanuvchilarning jarayonlarini korishga ruxsat beradi"
#: libraries/server_privileges.lib.php:212
#: libraries/server_privileges.lib.php:848 server_privileges.php:73
msgid "Allows importing data from and exporting data into files."
msgstr "Ma`lumotlarni fayldan import va faylga eksport qilishga ruxsat beradi"
msgstr "Ma`lumotlarni fayldan import va faylga eksport qilishga ruxsat beradi."
#: libraries/server_privileges.lib.php:217
#: libraries/server_privileges.lib.php:679
@ -10694,17 +10694,17 @@ msgstr "MySQL-serverning ushbu versiyada bunday xususiyat mavjud emas!"
#: libraries/server_privileges.lib.php:222
#: libraries/server_privileges.lib.php:876 server_privileges.php:75
msgid "Allows creating and dropping indexes."
msgstr "Indekslar qoshish va ularni ochirishga ruxsat beradi"
msgstr "Indekslar qoshish va ularni ochirishga ruxsat beradi."
#: libraries/server_privileges.lib.php:227
#: libraries/server_privileges.lib.php:874 server_privileges.php:60
msgid "Allows altering the structure of existing tables."
msgstr "Mavjud jadvallarning tuzilishini ozgartirishga ruxsat beradi"
msgstr "Mavjud jadvallarning tuzilishini ozgartirishga ruxsat beradi."
#: libraries/server_privileges.lib.php:232
#: libraries/server_privileges.lib.php:964 server_privileges.php:88
msgid "Gives access to the complete list of databases."
msgstr "Ma`lumotlar bazalarining toliq royxatiga ruxsat beradi"
msgstr "Ma`lumotlar bazalarining toliq royxatiga ruxsat beradi."
#: libraries/server_privileges.lib.php:237
#: libraries/server_privileges.lib.php:948 server_privileges.php:91
@ -10716,37 +10716,37 @@ msgstr ""
"Ulanishlar maksimal qiymatga yetganda ham ulanish ornatishga ruxsat "
"beradi. (Kopgina administrativ vazifalarni bajarish uchun kerak, masalan, "
"global ozgaruvchilar ornatish yoki boshqa foydalanuvchi jarayonini "
"ochirish)"
"ochirish)."
#: libraries/server_privileges.lib.php:242
#: libraries/server_privileges.lib.php:886 server_privileges.php:65
msgid "Allows creating temporary tables."
msgstr "Vaqtinchalik jadvallar tuzishga ruxsat beradi"
msgstr "Vaqtinchalik jadvallar tuzishga ruxsat beradi."
#: libraries/server_privileges.lib.php:247
#: libraries/server_privileges.lib.php:969 server_privileges.php:77
msgid "Allows locking tables for the current thread."
msgstr "Joriy oqim uchun jadvalni blokirovku qilishga ruxsat beradi"
msgstr "Joriy oqim uchun jadvalni blokirovku qilishga ruxsat beradi."
#: libraries/server_privileges.lib.php:252
#: libraries/server_privileges.lib.php:982 server_privileges.php:86
msgid "Needed for the replication slaves."
msgstr ""
"Replikatsiya (zaxira nusxa kochirish) vaqtida tobe serverlar uchun kerak"
"Replikatsiya (zaxira nusxa kochirish) vaqtida tobe serverlar uchun kerak."
#: libraries/server_privileges.lib.php:257
#: libraries/server_privileges.lib.php:978 server_privileges.php:85
msgid "Allows the user to ask where the slaves / masters are."
msgstr ""
"Bosh va tobe serverlarning joylashishi haqidagi ma`lumotni talab qilishga "
"ruxsat beradi"
"ruxsat beradi."
#: libraries/server_privileges.lib.php:262
#: libraries/server_privileges.lib.php:278
#: libraries/server_privileges.lib.php:906
#: libraries/server_privileges.lib.php:913 server_privileges.php:67
msgid "Allows creating new views."
msgstr "Yangi namoyishlar tuzish(CREATE VIEW)ga ruxsat beradi"
msgstr "Yangi namoyishlar tuzish(CREATE VIEW)ga ruxsat beradi."
#: libraries/server_privileges.lib.php:267
#: libraries/server_privileges.lib.php:920 server_privileges.php:71
@ -10764,28 +10764,29 @@ msgstr ""
#: libraries/server_privileges.lib.php:289
#: libraries/server_privileges.lib.php:890 server_privileges.php:89
msgid "Allows performing SHOW CREATE VIEW queries."
msgstr "Namoyish tuzadigan sorov(SHOW CREATE VIEW)ni bajarishga ruxsat beradi"
msgstr "Namoyish tuzadigan sorov(SHOW CREATE VIEW)ni bajarishga ruxsat beradi."
#: libraries/server_privileges.lib.php:294
#: libraries/server_privileges.lib.php:894 server_privileges.php:63
msgid "Allows creating stored routines."
msgstr "Saqlanadigan muolajalar tuzishga ruxsat beradi"
msgstr "Saqlanadigan muolajalar tuzishga ruxsat beradi."
#: libraries/server_privileges.lib.php:299
#: libraries/server_privileges.lib.php:898 server_privileges.php:61
msgid "Allows altering and dropping stored routines."
msgstr "Saqlanadigan muolajalarni ozgartirish va ochirishga ruxsat beradi"
msgstr "Saqlanadigan muolajalarni ozgartirish va ochirishga ruxsat beradi."
#: libraries/server_privileges.lib.php:304
#: libraries/server_privileges.lib.php:986 server_privileges.php:66
msgid "Allows creating, dropping and renaming user accounts."
msgstr ""
"Foydalanuvchilar hisobini qoshish, ochirish va ozgartirishga ruxsat beradi"
"Foydalanuvchilar hisobini qoshish, ochirish va ozgartirishga ruxsat "
"beradi."
#: libraries/server_privileges.lib.php:309
#: libraries/server_privileges.lib.php:900 server_privileges.php:72
msgid "Allows executing stored routines."
msgstr "Saqlanadigan muolajalarni bajarishga ruxsat beradi"
msgstr "Saqlanadigan muolajalarni bajarishga ruxsat beradi."
#: libraries/server_privileges.lib.php:357
#: libraries/server_privileges.lib.php:358
@ -10809,7 +10810,7 @@ msgstr ""
#: libraries/server_privileges.lib.php:537 server_privileges.php:79
msgid "Limits the number of queries the user may send to the server per hour."
msgstr ""
"Foydalanuvchi bir soat davomida yuborishi mumkin bolgan sorovlar soni"
"Foydalanuvchi bir soat davomida yuborishi mumkin bolgan sorovlar soni."
#: libraries/server_privileges.lib.php:544
#: libraries/server_privileges.lib.php:550 server_privileges.php:80
@ -10818,21 +10819,21 @@ msgid ""
"execute per hour."
msgstr ""
"Foydalanuvchi bir soat davomida bajarishi mumkin bolgan biron-bir jadval "
"yoki ma`lumotlar bazasini ozgartiradigan buyruqlar soni"
"yoki ma`lumotlar bazasini ozgartiradigan buyruqlar soni."
#: libraries/server_privileges.lib.php:557
#: libraries/server_privileges.lib.php:562 server_privileges.php:78
msgid "Limits the number of new connections the user may open per hour."
msgstr ""
"Foydalanuvchi bir soat davomida ornatishi mumkin bolgan yangi ulanishlar "
"soni"
"soni."
#: libraries/server_privileges.lib.php:569
#: libraries/server_privileges.lib.php:577 server_privileges.php:81
msgid "Limits the number of simultaneous connections the user may have."
msgstr ""
"Bir foydalanuvchi tomonidan bir vaqtning ozida ornatishi mumkin bolgan "
"ulanishlar soni"
"ulanishlar soni."
#: libraries/server_privileges.lib.php:630
#: libraries/server_privileges.lib.php:804
@ -10863,18 +10864,18 @@ msgstr "Ma`lumotlar bazasi privilegiyalari"
#: libraries/server_privileges.lib.php:869 server_privileges.php:64
msgid "Allows creating new tables."
msgstr "Yangi jadvallar tuzishga ruxsat beradi"
msgstr "Yangi jadvallar tuzishga ruxsat beradi."
#: libraries/server_privileges.lib.php:881 server_privileges.php:70
msgid "Allows dropping tables."
msgstr "Jadvallarni ochirishga rux`sat beradi"
msgstr "Jadvallarni ochirishga rux`sat beradi."
#: libraries/server_privileges.lib.php:942 server_privileges.php:74
msgid ""
"Allows adding users and privileges without reloading the privilege tables."
msgstr ""
"Foydalanuvchilarni qoshish va privilegiyalar jadvalini qayta yuklamasdan "
"privilegiyalar qoshishga ruxsat beradi"
"privilegiyalar qoshishga ruxsat beradi."
#: libraries/server_privileges.lib.php:1050
msgid "Login Information"

View File

@ -16,6 +16,8 @@ require_once 'libraries/common.inc.php';
require_once 'libraries/display_change_password.lib.php';
require_once 'libraries/server_privileges.lib.php';
$cfgRelation = PMA_getRelationsParam();
/**
* Does the common work
*/
@ -24,6 +26,11 @@ $header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('server_privileges.js');
if ($GLOBALS['cfgRelation']['menuswork']) {
$response->addHTML('<div>');
$response->addHTML(PMA_getHtmlForSubMenusOnUsersPage('server_privileges.php'));
}
$_add_user_error = false;
if (isset ($_REQUEST['username'])) {
@ -228,6 +235,9 @@ if (isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) {
$_error, $real_sql_query, $sql_query, $username, $hostname,
isset($dbname) ? $dbname : null
);
if (! empty($_REQUEST['userGroup']) && $cfgRelation['menuswork']) {
PMA_setUserGroup($GLOBALS['username'], $_REQUEST['userGroup']);
}
} else {
if (isset($create_user_real)) {
@ -268,6 +278,14 @@ if (! empty($_POST['update_privs'])) {
);
}
/**
* Assign users to user groups
*/
if (! empty($_REQUEST['changeUserGroup']) && $cfgRelation['menuswork']) {
PMA_setUserGroup($username, $_REQUEST['userGroup']);
$message = PMA_Message::success();
}
/**
* Revokes Privileges
*/
@ -378,6 +396,7 @@ if ($GLOBALS['is_ajax_request']
&& (! isset($_REQUEST['initial']) || empty($_REQUEST['initial']))
&& ! isset($_REQUEST['showall'])
&& ! isset($_REQUEST['edit_user_dialog'])
&& ! isset($_REQUEST['edit_user_group_dialog'])
&& ! isset($_REQUEST['db_specific'])
) {
$extra_data = PMA_getExtraDataForAjaxBehavior(
@ -424,6 +443,18 @@ if (isset($_REQUEST['viewing_mode']) && $_REQUEST['viewing_mode'] == 'db') {
* Displays the page
*/
if (! empty($_REQUEST['edit_user_group_dialog']) && $cfgRelation['menuswork']) {
$dialog = PMA_getHtmlToChoseUserGroup($username);
$response = PMA_Response::getInstance();
if ($GLOBALS['is_ajax_request']) {
$response->addJSON('message', $dialog);
exit;
} else {
$response->addHTML($dialog);
}
}
// export user definition
if (isset($_REQUEST['export'])
|| (isset($_REQUEST['submit_mult']) && $_REQUEST['submit_mult'] == 'export')
@ -491,4 +522,8 @@ if (empty($_REQUEST['adduser'])
);
} // end if (empty($_REQUEST['adduser']) && empty($checkprivs))... elseif... else...
if ($GLOBALS['cfgRelation']['menuswork']) {
$response->addHTML('</div>');
}
?>

View File

@ -9,6 +9,7 @@
require_once 'libraries/common.inc.php';
require_once 'libraries/server_common.inc.php';
require_once 'libraries/ServerStatusData.class.php';
require_once 'libraries/server_status.lib.php';
/**
* Replication library
@ -46,513 +47,9 @@ if (! empty($_REQUEST['kill'])) {
$response = PMA_Response::getInstance();
$response->addHTML('<div>');
$response->addHTML($ServerStatusData->getMenuHtml());
$response->addHTML(PMA_getServerStatusHtml($ServerStatusData));
$response->addHTML(PMA_getHtmlForServerStatus($ServerStatusData));
$response->addHTML('</div>');
exit;
/**
* Prints server status information: processes, connections and traffic
*
* @param Object $ServerStatusData An instance of the PMA_ServerStatusData class
*
* @return string
*/
function PMA_getServerStatusHtml($ServerStatusData)
{
//display the server state General Information
$retval = PMA_getServerStateGeneralInfoHtml($ServerStatusData);
//display the server state traffic information
$retval .= PMA_getServerStateTrafficHtml($ServerStatusData);
//display the server state connection information
$retval .= PMA_getServerStateConnectionsHtml($ServerStatusData);
//display the server Process List information
$retval .= PMA_getServerProcesslistHtml($ServerStatusData);
return $retval;
}
/**
* Prints server state General information
*
* @param Object $ServerStatusData An instance of the PMA_ServerStatusData class
*
* @return string
*/
function PMA_getServerStateGeneralInfoHtml($ServerStatusData)
{
$start_time = $GLOBALS['dbi']->fetchValue(
'SELECT UNIX_TIMESTAMP() - ' . $ServerStatusData->status['Uptime']
);
$retval = '<h3>';
$retval .= sprintf(
__('Network traffic since startup: %s'),
implode(
' ',
PMA_Util::formatByteDown(
$ServerStatusData->status['Bytes_received'] + $ServerStatusData->status['Bytes_sent'],
3,
1
)
)
);
$retval .= '</h3>';
$retval .= '<p>';
$retval .= sprintf(
__('This MySQL server has been running for %1$s. It started up on %2$s.'),
PMA_Util::timespanFormat($ServerStatusData->status['Uptime']),
PMA_Util::localisedDate($start_time)
) . "\n";
$retval .= '</p>';
if ($GLOBALS['server_master_status'] || $GLOBALS['server_slave_status']) {
$retval .= '<p class="notice">';
if ($GLOBALS['server_master_status'] && $GLOBALS['server_slave_status']) {
$retval .= __(
'This MySQL server works as <b>master</b> and '
. '<b>slave</b> in <b>replication</b> process.'
);
} elseif ($GLOBALS['server_master_status']) {
$retval .= __(
'This MySQL server works as <b>master</b> '
. 'in <b>replication</b> process.'
);
} elseif ($GLOBALS['server_slave_status']) {
$retval .= __(
'This MySQL server works as <b>slave</b> '
. 'in <b>replication</b> process.'
);
}
$retval .= '</p>';
}
/*
* if the server works as master or slave in replication process,
* display useful information
*/
if ($GLOBALS['server_master_status'] || $GLOBALS['server_slave_status']) {
$retval .= '<hr class="clearfloat" />';
$retval .= '<h3><a name="replication">';
$retval .= __('Replication status');
$retval .= '</a></h3>';
foreach ($GLOBALS['replication_types'] as $type) {
if (isset(${"server_{$type}_status"}) && ${"server_{$type}_status"}) {
$retval .= PMA_getHtmlForReplicationStatusTable($type);
}
}
}
return $retval;
}
/**
* Prints server state traffic information
*
* @param Object $ServerStatusData An instance of the PMA_ServerStatusData class
*
* @return string
*/
function PMA_getServerStateTrafficHtml($ServerStatusData)
{
$hour_factor = 3600 / $ServerStatusData->status['Uptime'];
$retval = '<table id="serverstatustraffic" class="data noclick">';
$retval .= '<thead>';
$retval .= '<tr>';
$retval .= '<th colspan="2">';
$retval .= __('Traffic') . '&nbsp;';
$retval .= PMA_Util::showHint(
__(
'On a busy server, the byte counters may overrun, so those statistics '
. 'as reported by the MySQL server may be incorrect.'
)
);
$retval .= '</th>';
$retval .= '<th>&oslash; ' . __('per hour') . '</th>';
$retval .= '</tr>';
$retval .= '</thead>';
$retval .= '<tbody>';
$retval .= '<tr class="odd">';
$retval .= '<th class="name">' . __('Received') . '</th>';
$retval .= '<td class="value">';
$retval .= implode(
' ',
PMA_Util::formatByteDown(
$ServerStatusData->status['Bytes_received'], 3, 1
)
);
$retval .= '</td>';
$retval .= '<td class="value">';
$retval .= implode(
' ',
PMA_Util::formatByteDown(
$ServerStatusData->status['Bytes_received'] * $hour_factor, 3, 1
)
);
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '<tr class="even">';
$retval .= '<th class="name">' . __('Sent') . '</th>';
$retval .= '<td class="value">';
$retval .= implode(
' ',
PMA_Util::formatByteDown(
$ServerStatusData->status['Bytes_sent'], 3, 1
)
);
$retval .= '</td>';
$retval .= '<td class="value"><?php echo';
$retval .= implode(
' ',
PMA_Util::formatByteDown(
$ServerStatusData->status['Bytes_sent'] * $hour_factor, 3, 1
)
);
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '<tr class="odd">';
$retval .= '<th class="name">' . __('Total') . '</th>';
$retval .= '<td class="value">';
$retval .= implode(
' ',
PMA_Util::formatByteDown(
$ServerStatusData->status['Bytes_received'] + $ServerStatusData->status['Bytes_sent'], 3, 1
)
);
$retval .= '</td>';
$retval .= '<td class="value">';
$retval .= implode(
' ',
PMA_Util::formatByteDown(
($ServerStatusData->status['Bytes_received'] + $ServerStatusData->status['Bytes_sent'])
* $hour_factor, 3, 1
)
);
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '</tbody>';
$retval .= '</table>';
return $retval;
}
/**
* Prints server state connections information
*
* @param Object $ServerStatusData An instance of the PMA_ServerStatusData class
*
* @return string
*/
function PMA_getServerStateConnectionsHtml($ServerStatusData)
{
$hour_factor = 3600 / $ServerStatusData->status['Uptime'];
$retval = '<table id="serverstatusconnections" class="data noclick">';
$retval .= '<thead>';
$retval .= '<tr>';
$retval .= '<th colspan="2">' . __('Connections') . '</th>';
$retval .= '<th>&oslash; ' . __('per hour') . '</th>';
$retval .= '<th>%</th>';
$retval .= '</tr>';
$retval .= '</thead>';
$retval .= '<tbody>';
$retval .= '<tr class="odd">';
$retval .= '<th class="name">' . __('max. concurrent connections') . '</th>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Max_used_connections'], 0
);
$retval .= '</td>';
$retval .= '<td class="value">--- </td>';
$retval .= '<td class="value">--- </td>';
$retval .= '</tr>';
$retval .= '<tr class="even">';
$retval .= '<th class="name">' . __('Failed attempts') . '</th>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Aborted_connects'], 4, 1, true
);
$retval .= '</td>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Aborted_connects'] * $hour_factor, 4, 2, true
);
$retval .= '</td>';
$retval .= '<td class="value">';
if ($ServerStatusData->status['Connections'] > 0) {
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Aborted_connects'] * 100 / $ServerStatusData->status['Connections'],
0, 2, true
);
$retval .= '%';
} else {
$retval .= '--- ';
}
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '<tr class="odd">';
$retval .= '<th class="name">' . __('Aborted') . '</th>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Aborted_clients'], 4, 1, true
);
$retval .= '</td>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Aborted_clients'] * $hour_factor, 4, 2, true
);
$retval .= '</td>';
$retval .= '<td class="value">';
if ($ServerStatusData->status['Connections'] > 0) {
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Aborted_clients'] * 100 / $ServerStatusData->status['Connections'],
0, 2, true
);
$retval .= '%';
} else {
$retval .= '--- ';
}
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '<tr class="even">';
$retval .= '<th class="name">' . __('Total') . '</th>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Connections'], 4, 0
);
$retval .= '</td>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(
$ServerStatusData->status['Connections'] * $hour_factor, 4, 2
);
$retval .= '</td>';
$retval .= '<td class="value">';
$retval .= PMA_Util::formatNumber(100, 0, 2);
$retval .= '%</td>';
$retval .= '</tr>';
$retval .= '</tbody>';
$retval .= '</table>';
return $retval;
}
/**
* Prints Server Process list
*
* @param Object $ServerStatusData An instance of the PMA_ServerStatusData class
*
* @return string
*/
function PMA_getServerProcesslistHtml($ServerStatusData)
{
$url_params = array();
$show_full_sql = ! empty($_REQUEST['full']);
if ($show_full_sql) {
$url_params['full'] = 1;
$full_text_link = 'server_status.php' . PMA_generate_common_url(
array(), 'html', '?'
);
} else {
$full_text_link = 'server_status.php' . PMA_generate_common_url(
array('full' => 1)
);
}
// This array contains display name and real column name of each
// sortable column in the table
$sortable_columns = array(
array(
'column_name' => __('ID'),
'order_by_field' => 'Id'
),
array(
'column_name' => __('User'),
'order_by_field' => 'User'
),
array(
'column_name' => __('Host'),
'order_by_field' => 'Host'
),
array(
'column_name' => __('Database'),
'order_by_field' => 'db'
),
array(
'column_name' => __('Command'),
'order_by_field' => 'Command'
),
array(
'column_name' => __('Time'),
'order_by_field' => 'Time'
),
array(
'column_name' => __('Status'),
'order_by_field' => 'State'
),
array(
'column_name' => __('SQL query'),
'order_by_field' => 'Info'
)
);
$sortable_columns_count = count($sortable_columns);
if (PMA_DRIZZLE) {
$left_str = 'left(p.info, '
. (int)$GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] . ')';
$sql_query = "SELECT
p.id AS Id,
p.username AS User,
p.host AS Host,
p.db AS db,
p.command AS Command,
p.time AS Time,
p.state AS State,"
. ($show_full_sql ? 's.query' : $left_str )
. " AS Info FROM data_dictionary.PROCESSLIST p "
. ($show_full_sql
? 'LEFT JOIN data_dictionary.SESSIONS s ON s.session_id = p.id'
: '');
if (! empty($_REQUEST['order_by_field'])
&& ! empty($_REQUEST['sort_order'])
) {
$sql_query .= ' ORDER BY p.' . $_REQUEST['order_by_field'] . ' '
. $_REQUEST['sort_order'];
}
} else {
$sql_query = $show_full_sql
? 'SHOW FULL PROCESSLIST'
: 'SHOW PROCESSLIST';
if (! empty($_REQUEST['order_by_field'])
&& ! empty($_REQUEST['sort_order'])
) {
$sql_query = 'SELECT * FROM `INFORMATION_SCHEMA`.`PROCESSLIST` ORDER BY `'
. $_REQUEST['order_by_field'] . '` ' . $_REQUEST['sort_order'];
}
}
$result = $GLOBALS['dbi']->query($sql_query);
$retval = '<table id="tableprocesslist" class="data clearfloat noclick sortable">';
$retval .= '<thead>';
$retval .= '<tr>';
$retval .= '<th>' . __('Processes') . '</th>';
foreach ($sortable_columns as $column) {
$is_sorted = ! empty($_REQUEST['order_by_field'])
&& ! empty($_REQUEST['sort_order'])
&& ($_REQUEST['order_by_field'] == $column['order_by_field']);
$column['sort_order'] = 'ASC';
if ($is_sorted && $_REQUEST['sort_order'] === 'ASC') {
$column['sort_order'] = 'DESC';
}
if ($is_sorted) {
if ($_REQUEST['sort_order'] == 'ASC') {
$asc_display_style = 'inline';
$desc_display_style = 'none';
} elseif ($_REQUEST['sort_order'] == 'DESC') {
$desc_display_style = 'inline';
$asc_display_style = 'none';
}
}
$retval .= '<th>';
$retval .= '<a href="server_status.php' . PMA_generate_common_url($column) . '" ';
if ($is_sorted) {
$retval .= 'onmouseout="$(\'.soimg\').toggle()" '
. 'onmouseover="$(\'.soimg\').toggle()"';
}
$retval .= '>';
$retval .= $column['column_name'];
if ($is_sorted) {
$retval .= '<img class="icon ic_s_desc soimg" alt="'
. __('Descending') . '" title="" src="themes/dot.gif" '
. 'style="display: ' . $desc_display_style . '" />';
$retval .= '<img class="icon ic_s_asc soimg hide" alt="'
. __('Ascending') . '" title="" src="themes/dot.gif" '
. 'style="display: ' . $asc_display_style . '" />';
}
$retval .= '</a>';
if (! PMA_DRIZZLE && (0 === --$sortable_columns_count)) {
$retval .= '<a href="' . $full_text_link . '">';
if ($show_full_sql) {
$retval .= PMA_Util::getImage(
's_partialtext.png',
__('Truncate Shown Queries')
);
} else {
$retval .= PMA_Util::getImage(
's_fulltext.png',
__('Show Full Queries')
);
}
$retval .= '</a>';
}
$retval .= '</th>';
}
$retval .= '</tr>';
$retval .= '</thead>';
$retval .= '<tbody>';
$odd_row = true;
while ($process = $GLOBALS['dbi']->fetchAssoc($result)) {
// Array keys need to modify due to the way it has used
// to display column values
if (! empty($_REQUEST['order_by_field'])
&& ! empty($_REQUEST['sort_order'])
) {
foreach (array_keys($process) as $key) {
$new_key = ucfirst(strtolower($key));
$process[$new_key] = $process[$key];
unset($process[$key]);
}
}
$url_params['kill'] = $process['Id'];
$kill_process = 'server_status.php' . PMA_generate_common_url($url_params);
$retval .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
$retval .= '<td><a href="' . $kill_process . '">' . __('Kill') . '</a></td>';
$retval .= '<td class="value">' . $process['Id'] . '</td>';
$retval .= '<td>' . $process['User'] . '</td>';
$retval .= '<td>' . $process['Host'] . '</td>';
$retval .= '<td>' . ((! isset($process['db']) || ! strlen($process['db']))
? '<i>' . __('None') . '</i>'
: $process['db']) . '</td>';
$retval .= '<td>' . $process['Command'] . '</td>';
$retval .= '<td class="value">' . $process['Time'] . '</td>';
$retval .= '<td>' . (empty($process['State']) ? '---' : $process['State']) . '</td>';
$retval .= '<td>';
if (empty($process['Info'])) {
$retval .= '---';
} else {
if (! $show_full_sql && strlen($process['Info']) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
$retval .= htmlspecialchars(substr($process['Info'], 0, $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']))
. '[...]';
} else {
$retval .= '<code class="sql"><pre>'
. $process['Info']
. '</pre></code>';
}
}
$retval .= '</td>';
$retval .= '</tr>';
$odd_row = ! $odd_row;
}
$retval .= '</tbody>';
$retval .= '</table>';
return $retval;
}
?>

View File

@ -9,6 +9,8 @@
require_once 'libraries/common.inc.php';
require_once 'libraries/Advisor.class.php';
require_once 'libraries/ServerStatusData.class.php';
require_once 'libraries/server_status_advisor.lib.php';
if (PMA_DRIZZLE) {
$server_master_status = false;
$server_slave_status = false;
@ -28,62 +30,10 @@ $scripts->addFile('server_status_advisor.js');
*/
$response->addHTML('<div>');
$response->addHTML($ServerStatusData->getMenuHtml());
$response->addHTML(PMA_getAdvisorHtml());
$response->addHTML(PMA_getHtmlForAdvisor());
$response->addHTML('</div>');
exit;
/**
* Returns html with Advisor
*
* @return string
*/
function PMA_getAdvisorHtml()
{
$output = '<a href="#openAdvisorInstructions">';
$output .= PMA_Util::getIcon('b_help.png', __('Instructions'));
$output .= '</a>';
$output .= '<div id="statustabs_advisor"></div>';
$output .= '<div id="advisorInstructionsDialog" style="display:none;">';
$output .= '<p>';
$output .= __(
'The Advisor system can provide recommendations '
. 'on server variables by analyzing the server status variables.'
);
$output .= '</p>';
$output .= '<p>';
$output .= __(
'Do note however that this system provides recommendations '
. 'based on simple calculations and by rule of thumb which may '
. 'not necessarily apply to your system.'
);
$output .= '</p>';
$output .= '<p>';
$output .= __(
'Prior to changing any of the configuration, be sure to know '
. 'what you are changing (by reading the documentation) and how '
. 'to undo the change. Wrong tuning can have a very negative '
. 'effect on performance.'
);
$output .= '</p>';
$output .= '<p>';
$output .= __(
'The best way to tune your system would be to change only one '
. 'setting at a time, observe or benchmark your database, and undo '
. 'the change if there was no clearly measurable improvement.'
);
$output .= '</p>';
$output .= '</div>';
$output .= '<div id="advisorData" style="display:none;">';
$advisor = new Advisor();
$output .= htmlspecialchars(
json_encode(
$advisor->run()
)
);
$output .= '</div>';
return $output;
}
?>

59
server_user_groups.php Normal file
View File

@ -0,0 +1,59 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Displays the 'User groups' sub page under 'Users' page.
*
* @package PhpMyAdmin
*/
require_once 'libraries/common.inc.php';
require_once 'libraries/server_privileges.lib.php';
PMA_getRelationsParam();
if (! $GLOBALS['cfgRelation']['menuswork']) {
exit;
}
$response = PMA_Response::getInstance();
$response->addHTML('<div>');
$response->addHTML(PMA_getHtmlForSubMenusOnUsersPage('server_user_groups.php'));
/**
* Delete user group
*/
if (! empty($_REQUEST['deleteUserGroup'])) {
PMA_deleteUserGroup($_REQUEST['userGroup']);
}
/**
* Add a new user group
*/
if (! empty($_REQUEST['addUserGroupSubmit'])) {
PMA_editUserGroup($_REQUEST['userGroup'], true);
}
/**
* Update a user group
*/
if (! empty($_REQUEST['editUserGroupSubmit'])) {
PMA_editUserGroup($_REQUEST['userGroup']);
}
if (isset($_REQUEST['viewUsers'])) {
// Display users belonging to a user group
$response->addHTML(PMA_getHtmlForListingUsersofAGroup($_REQUEST['userGroup']));
}
if (isset($_REQUEST['addUserGroup'])) {
// Display add user group dialog
$response->addHTML(PMA_getHtmlToEditUserGroup());
} elseif (isset($_REQUEST['editUserGroup'])) {
// Display edit user group dialog
$response->addHTML(PMA_getHtmlToEditUserGroup($_REQUEST['userGroup']));
} else {
// Display user groups table
$response->addHTML(PMA_getHtmlForUserGroupsTable());
}
$response->addHTML('</div>');
?>

138
sql.php
View File

@ -219,135 +219,19 @@ if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) {
);
} else {
// At least one row is returned -> displays a table with results
// If we are retrieving the full value of a truncated field or the original
// value of a transformed field, show it here and exit
if ($_REQUEST['grid_edit'] == true) {
PMA_sendResponseForGridEdit($result);
}
// Gets the list of fields properties
if (isset($result) && $result) {
$fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
}
// Should be initialized these parameters before parsing
$showtable = isset($showtable) ? $showtable : null;
$url_query = isset($url_query) ? $url_query : null;
$response = PMA_Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
// hide edit and delete links:
// - for information_schema
// - if the result set does not contain all the columns of a unique key
// and we are not just browing all the columns of an updatable view
$updatableView
= $justBrowsing
&& trim($analyzed_sql[0]['select_expr_clause']) == '*'
&& PMA_Table::isUpdatableView($db, $table);
$has_unique = PMA_resultSetContainsUniqueKey(
$db, $table, $fields_meta
);
$editable = $has_unique || $updatableView;
// Displays the results in a table
if (empty($disp_mode)) {
// see the "PMA_setDisplayMode()" function in
// libraries/DisplayResults.class.php
$disp_mode = 'urdr111101';
}
if (!empty($table) && ($GLOBALS['dbi']->isSystemSchema($db) || !$editable)) {
$disp_mode = 'nnnn110111';
}
if ( isset($_REQUEST['printview']) && $_REQUEST['printview'] == '1') {
$disp_mode = 'nnnn000000';
}
if (isset($_REQUEST['table_maintenance'])) {
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
if (isset($message)) {
$message = PMA_Message::success($message);
$table_maintenance_html = PMA_Util::getMessage(
$message, $GLOBALS['sql_query'], 'success'
);
}
$table_maintenance_html .= PMA_getHtmlForSqlQueryResultsTable(
isset($sql_data) ? $sql_data : null, $displayResultsObject, $db, $goto,
$pmaThemeImage, $text_dir, $url_query, $disp_mode, $sql_limit_to_append,
false, $unlim_num_rows, $num_rows, $showtable, $result, $querytime,
$analyzed_sql_results, false
);
if (empty($sql_data) || ($sql_data['valid_queries'] = 1)) {
$response->addHTML($table_maintenance_html);
exit();
}
}
if (!isset($_REQUEST['printview']) || $_REQUEST['printview'] != '1') {
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
unset($message);
//we don't need to buffer the output in getMessage here.
//set a global variable and check against it in the function
$GLOBALS['buffer_message'] = false;
}
$print_view_header_html = PMA_getHtmlForPrintViewHeader(
$db, $full_sql_query, $num_rows
);
$previous_update_query_html = PMA_getHtmlForPreviousUpdateQuery(
// At least one row is returned -> displays a table with results
PMA_sendResponseForResultsReturned(
isset($result) ? $result : null, $justBrowsing, $analyzed_sql_results,
$db, $table, isset($disp_mode) ? $disp_mode : null,
isset($message) ? $message : null, isset($sql_data) ? $sql_data : null,
$displayResultsObject, $goto, $pmaThemeImage,
$sql_limit_to_append, $unlim_num_rows,
$num_rows, $querytime, $full_sql_query,
isset($disp_query) ? $disp_query : null,
$cfg['ShowSQL'], isset($sql_data) ? $sql_data : null,
isset($disp_message) ? $disp_message : null
);
$profiling_chart_html = PMA_getHtmlForProfilingChart(
$disp_mode, $db, isset($profiling_results) ? $profiling_results : null
);
$missing_unique_column_msg = PMA_getMessageIfMissingColumnIndex(
$table, $db, $editable, $disp_mode
);
$bookmark_created_msg = PMA_getBookmarkCreatedMessage();
$table_html = PMA_getHtmlForSqlQueryResultsTable(
isset($sql_data) ? $sql_data : null, $displayResultsObject, $db, $goto,
$pmaThemeImage, $text_dir, $url_query, $disp_mode, $sql_limit_to_append,
$editable, $unlim_num_rows, $num_rows, $showtable, $result, $querytime,
$analyzed_sql_results, $is_procedure
);
$indexes_problems_html = PMA_getHtmlForIndexesProblems(
isset($disp_message) ? $disp_message : null, $profiling_results,
isset($query_type) ? $query_type : null,
isset($selected) ? $selected : null
isset($selected) ? $selected : null, $sql_query,
isset($complete_query) ? $complete_query : null, $cfg
);
$bookmark_support_html = PMA_getHtmlForBookmark(
$disp_mode, isset($cfg['Bookmark']) ? $cfg['Bookmark'] : '', $sql_query,
$db, $table, isset($complete_query) ? $complete_query : $sql_query,
$cfg['Bookmark']['user']
);
$print_button_html = PMA_getHtmlForPrintButton();
$html_output = isset($table_maintenance_html) ? $table_maintenance_html : '';
$html_output .= isset($print_view_header_html) ? $print_view_header_html : '';
$html_output .= PMA_getHtmlForSqlQueryResults(
$previous_update_query_html, $profiling_chart_html,
$missing_unique_column_msg, $bookmark_created_msg,
$table_html, $indexes_problems_html, $bookmark_support_html,
$print_button_html
);
$response->addHTML($html_output);
} // end rows returned
?>

View File

@ -34,4 +34,68 @@ $_SESSION[' PMA_token '] = 'token';
$GLOBALS['lang'] = 'en';
$GLOBALS['is_ajax_request'] = false;
define('PMA_HAS_RUNKIT', function_exists('runkit_constant_redefine'));
$GLOBALS['runkit_internal_override'] = ini_get('runkit.internal_override');
/**
* Function to emulate headers() function by storing headers in GLOBAL array.
*/
function test_header($string, $replace = true, $http_response_code = 200)
{
if (! isset($GLOBALS['header'])) {
$GLOBALS['header'] = array();
}
$GLOBALS['header'][] = $string;
}
/**
* Function to emulate headers_hest.
*/
function test_headers_sent()
{
return false;
}
if (PMA_HAS_RUNKIT && $GLOBALS['runkit_internal_override']) {
echo "Enabling headers testing...\n";
runkit_function_rename('header', 'test_header_override');
runkit_function_rename('headers_sent', 'test_headers_sent_override');
runkit_function_rename('test_header', 'header');
runkit_function_rename('test_headers_sent', 'headers_sent');
define('PMA_TEST_HEADERS', true);
} else {
echo "No headers testing.\n";
echo "Please install runkit and enable runkit.internal_override!\n";
}
/**
* Return the tag array to be used with assertTag by parsing
* a given HTML element
*
* @param string $elementHTML HTML for element to be parsed
* @param array $arr Additional array elements like content, parent
*
* @return array Tag array to be used with assertTag
*/
function PMA_getTagArray($elementHTML, $arr = array())
{
// get attributes
preg_match_all("/\s+(.*?)\=\s*\"(.*?)\"/is", $elementHTML, $matches);
foreach ($matches[1] as $key => $val) {
$arr['attributes'][trim($val)] = trim($matches[2][$key]);
}
$matches = array();
// get tag
preg_match("/^\<(.*?)(\s|\>)/i", $elementHTML, $matches);
if (isset($matches[1])) {
$arr['tag'] = trim($matches[1]);
}
return $arr;
}
?>

View File

@ -41,7 +41,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
/**
* tearDown for test cases
*
*
* @return void
*/
protected function tearDown()
@ -51,11 +51,11 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
/**
* Test for FormDisplay::__constructor
*
*
* @return void
*/
public function testFormDisplayContructor()
{
{
$this->assertCount(
5,
$this->readAttribute($this->object, '_jsLangStrings')
@ -64,13 +64,13 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
/**
* Test for FormDisplay::registerForm
*
*
* @return void
*/
public function testRegisterForm()
{
$reflection = new \ReflectionClass('FormDisplay');
$attrForms = $reflection->getProperty('_forms');
$attrForms->setAccessible(true);
@ -109,7 +109,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
/**
* Test for FormDisplay::process
*
*
* @return void
*/
public function testProcess()
@ -145,13 +145,13 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
/**
* Test for FormDisplay::displayErrors
*
*
* @return void
*/
public function testDisplayErrors()
{
$reflection = new \ReflectionClass('FormDisplay');
$attrIsValidated = $reflection->getProperty('_isValidated');
$attrIsValidated->setAccessible(true);
$attrIsValidated->setValue($this->object, true);
@ -192,13 +192,13 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
/**
* Test for FormDisplay::fixErrors
*
*
* @return void
*/
public function testFixErrors()
{
$reflection = new \ReflectionClass('FormDisplay');
$attrIsValidated = $reflection->getProperty('_isValidated');
$attrIsValidated->setAccessible(true);
$attrIsValidated->setValue($this->object, true);
@ -228,7 +228,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
$attrIsValidated->setValue($this->object, $arr);
$this->object->fixErrors();
$this->assertEquals(
array(
'Servers' => array(
@ -243,17 +243,17 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
/**
* Test for FormDisplay::_validateSelect
*
*
* @return void
*/
public function testValidateSelect()
{
{
$attrValidateSelect = new \ReflectionMethod(
'FormDisplay',
'_validateSelect'
);
$attrValidateSelect->setAccessible(true);
$arr = array('foo' => 'var');
$value = 'foo';
$this->assertTrue(
@ -284,7 +284,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
array(&$value, $arr)
)
);
$arr = array('1' => 'foobar');
$value = 0;
$this->assertFalse(
@ -297,7 +297,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
/**
* Test for FormDisplay::hasErrors
*
*
* @return void
*/
public function testHasErrors()
@ -321,7 +321,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
/**
* Test for FormDisplay::getDocLink
*
*
* @return void
*/
public function testGetDocLink()
@ -346,25 +346,25 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
/**
* Test for FormDisplay::getWikiLink
*
*
* @return void
*/
public function testGetWikiLink()
{
$this->assertEquals(
"./url.php?url=http%3A%2F%2Fwiki.phpmyadmin.net%2Fpma%2FConfig%23" .
"./url.php?url=http%3A%2F%2Fwiki.phpmyadmin.net%2Fpma%2FConfig%23" .
"AllowDeny.29&amp;server=0&amp;lang=en&amp;token=token",
$this->object->getWikiLink('Servers/1/AllowDeny')
);
$this->assertEquals(
"./url.php?url=http%3A%2F%2Fwiki.phpmyadmin.net%2Fpma%2FConfig%23" .
"./url.php?url=http%3A%2F%2Fwiki.phpmyadmin.net%2Fpma%2FConfig%23" .
"format_2&amp;server=0&amp;lang=en&amp;token=token",
$this->object->getWikiLink('Import/format')
);
$this->assertEquals(
"./url.php?url=http%3A%2F%2Fwiki.phpmyadmin.net%2Fpma%2FConfig%23" .
"./url.php?url=http%3A%2F%2Fwiki.phpmyadmin.net%2Fpma%2FConfig%23" .
"test&amp;server=0&amp;lang=en&amp;token=token",
$this->object->getWikiLink('Export/test')
);
@ -373,7 +373,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
/**
* Test for FormDisplay::_getOptName
*
*
* @return void
*/
public function testGetOptName()
@ -394,14 +394,14 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
/**
* Test for FormDisplay::_loadUserprefsInfo
*
*
* @return void
*/
public function testLoadUserprefsInfo()
{
$method = new \ReflectionMethod('FormDisplay', '_loadUserprefsInfo');
$method->setAccessible(true);
$attrUserprefs = new \ReflectionProperty(
'FormDisplay',
'_userprefsDisallow'
@ -417,12 +417,12 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
/**
* Test for FormDisplay::_setComments
*
*
* @return void
*/
public function testSetComments()
{
if (!function_exists('runkit_constant_redefine')) {
if (! PMA_HAS_RUNKIT) {
$this->markTestSkipped('Cannot redefine constant');
}
@ -447,11 +447,11 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
}
if (!function_exists('recode_string')) {
$expect['values']['recode'] .= " (unavailable)";
$expect['comment'] .= ($expect['comment'] ? ", " : '') .
$expect['comment'] .= ($expect['comment'] ? ", " : '') .
'"recode" requires recode extension';
}
$expect['comment_warning'] = 1;
$this->assertEquals(
$expect,
$opts
@ -531,7 +531,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
);
// SQLValidate
$GLOBALS['cfg']['SQLValidator']['use'] = false;
$method->invokeArgs(
@ -555,7 +555,7 @@ class PMA_FormDisplay_Test extends PHPUnit_Framework_TestCase
$GLOBALS['cfg']['MaxDbList'] = 10;
$GLOBALS['cfg']['MaxTableList'] = 10;
$GLOBALS['cfg']['QueryHistoryMax'] = 10;
$method->invokeArgs(
$this->object,
array('MaxDbList', &$opts)

View File

@ -0,0 +1,143 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* tests for AuthenticationConfig class
*
* @package PhpMyAdmin-test
*/
require_once 'libraries/plugins/auth/AuthenticationConfig.class.php';
require_once 'libraries/Util.class.php';
require_once 'libraries/Theme.class.php';
require_once 'libraries/Config.class.php';
require_once 'libraries/php-gettext/gettext.inc';
require_once 'libraries/config.default.php';
require_once 'libraries/Error_Handler.class.php';
/**
* tests for AuthenticationConfig class
*
* @package PhpMyAdmin-test
*/
class PMA_AuthenticationConfig_Test extends PHPUnit_Framework_TestCase
{
protected $object;
/**
* Configures global environment.
*
* @return void
*/
function setup()
{
$GLOBALS['PMA_Config'] = new PMA_Config();
$GLOBALS['PMA_Config']->enableBc();
$GLOBALS['server'] = 0;
$this->object = new AuthenticationConfig(null);
}
/**
* tearDown for test cases
*
* @return void
*/
public function tearDown()
{
unset($this->object);
}
/**
* Test for AuthenticationConfig::auth
*
* @return void
*/
public function testAuth()
{
$this->assertTrue(
$this->object->auth()
);
}
/**
* Test for AuthenticationConfig::authCheck
*
* @return void
*/
public function testAuthCheck()
{
$this->assertTrue(
$this->object->authCheck()
);
}
/**
* Test for AuthenticationConfig::authSetUser
*
* @return void
*/
public function testAuthSetUser()
{
$this->assertTrue(
$this->object->authSetUser()
);
}
/**
* Test for AuthenticationConfig::authFails
*
* @return void
*/
public function testAuthFails()
{
$removeConstant = false;
$GLOBALS['error_handler'] = new PMA_Error_Handler;
$GLOBALS['cfg']['Servers'] = array(1);
$GLOBALS['allowDeny_forbidden'] = false;
if (!defined('PMA_USR_BROWSER_AGENT')) {
define('PMA_USR_BROWSER_AGENT', 'chrome');
$removeConstant = true;
if (! PMA_HAS_RUNKIT) {
$this->markTestSkipped('Cannot remove constant');
}
}
ob_start();
$result = $this->object->authFails();
$html = ob_get_clean();
$this->assertTrue(
$result
);
$this->assertContains(
'You probably did not create a configuration file. You might want ' .
'to use the <a href="setup/">setup script</a> to create one.',
$html
);
$this->assertContains(
'<strong>MySQL said: </strong><a href="./url.php?url=http%3A%2F%2F' .
'dev.mysql.com%2Fdoc%2Frefman%2F5.6%2Fen%2Ferror-messages-server.html' .
'&amp;server=0&amp;lang=en&amp;token=token" target="mysql_doc">' .
'<img src="themes/dot.gif" title="Documentation" alt="Documentation" ' .
'class="icon ic_b_help" /></a>',
$html
);
$this->assertContains(
'Cannot connect: invalid settings.',
$html
);
$this->assertContains(
'<a href="index.php?server=0&amp;lang=en&amp;token=token" ' .
'class="button disableAjax">Retry to connect</a>',
$html
);
if ($removeConstant) {
runkit_constant_remove('PMA_USR_BROWSER_AGENT');
}
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,7 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase
unset($_SESSION[$this->readAttribute($this->object, "_id")]);
unset($this->object);
// reset the instance
$attr_instance = new ReflectionProperty("ConfigFile", "_instance");
$attr_instance->setAccessible(true);
@ -58,7 +58,7 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase
* @test
*/
public function testConfigFileConstructor()
{
{
$attr_instance = new ReflectionProperty("ConfigFile", "_instance");
$attr_instance->setAccessible(true);
$attr_instance->setValue(null, null);
@ -237,7 +237,7 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase
*/
public function testConfigFileSet()
{
if (!function_exists("runkit_constant_redefine")) {
if (! PMA_HAS_RUNKIT) {
$this->markTestSkipped("Cannot redefine constant");
}

View File

@ -21,37 +21,9 @@ require_once 'libraries/user_preferences.lib.php';
*/
class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
{
/**
* Return the tag array to be used with assertTag by parsing
* a given HTML element
*
* @param string $elementHTML HTML for element to be parsed
* @param array $arr Additional array elements like content, parent
*
* @return array Tag array to be used with assertTag
*/
private function _getTagArray($elementHTML, $arr = array())
{
// get attributes
preg_match_all("/\s+(.*?)\=\s*\"(.*?)\"/is", $elementHTML, $matches);
foreach ($matches[1] as $key => $val) {
$arr['attributes'][trim($val)] = trim($matches[2][$key]);
}
$matches = array();
// get tag
preg_match("/^\<(.*?)(\s|\>)/i", $elementHTML, $matches);
if (isset($matches[1])) {
$arr['tag'] = trim($matches[1]);
}
return $arr;
}
/**
* Test for PMA_displayFormTop()
*
*
* @return void
*/
public function testDisplayFormTop()
@ -63,22 +35,22 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray(
'<form method="get" action="http://www.phpmyadmin.net" ' .
PMA_getTagArray(
'<form method="get" action="http://www.phpmyadmin.net" ' .
'class="config-form disableAjax">'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="hidden" name="tab_hash" value="" />'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="hidden" name="check_page_refresh" ' .
'id="check_page_refresh" value="" />'
),
@ -86,21 +58,21 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="hidden" name="lang" value="en" />'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="hidden" name="token" value="token" />'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="hidden" name="0" value="1" />'
),
$result
@ -109,7 +81,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_displayTabsTop()
*
*
* @return void
*/
public function testDisplayTabsTop()
@ -119,29 +91,29 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray('<ul class="tabs">'),
PMA_getTagArray('<ul class="tabs">'),
$result
);
$this->assertTag(
$this->_getTagArray('<a href="#0">', array('content' => 'one')),
PMA_getTagArray('<a href="#0">', array('content' => 'one')),
$result
);
$this->assertTag(
$this->_getTagArray('<a href="#1">', array('content' => 'two')),
PMA_getTagArray('<a href="#1">', array('content' => 'two')),
$result
);
$this->assertTag(
$this->_getTagArray('<div class="tabs_contents">'),
PMA_getTagArray('<div class="tabs_contents">'),
$result
);
}
/**
* Test for PMA_displayFieldsetTop()
*
*
* @return void
*/
public function testDisplayFieldsetTop()
@ -154,14 +126,14 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<fieldset class="optbox" name="attrname">'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<legend>',
array(
'content' => 'TitleTest',
@ -172,7 +144,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<p>',
array(
'content' => 'DescTest',
@ -182,14 +154,14 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<dl class="errors">'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<dd>',
array('content' => 'e1', 'parent' => array('tag' => 'dl'))
),
@ -197,7 +169,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<dd>',
array('content' => 'e2', 'parent' => array('tag' => 'dl'))
),
@ -205,7 +177,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<table width="100%" cellspacing="0">'
),
$result
@ -214,12 +186,12 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_displayInput()
*
*
* @return void
*/
public function testDisplayInput()
{
if (!function_exists('runkit_constant_remove')) {
{
if (! PMA_HAS_RUNKIT) {
$this->markTestSkipped('Cannot modify constant');
}
@ -241,16 +213,16 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
'desc', false, $opts
);
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<tr class="group-header-field group-header-1 disabled-field">'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<label for="test/path">',
array('content' => 'testName')
),
@ -258,7 +230,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<a href="http://doclink" target="documentation">',
array(
'parent' => array(
@ -271,7 +243,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<img src="testImageb_help.png" title="Documentation" ' .
'alt="Documentation" />',
array(
@ -282,28 +254,28 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<a href="http://wikilink" target="wiki">'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<img src="testImageb_info.png" title="Wiki" alt="Wiki" />'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<span class="disabled-notice">'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<small>',
array('content' => 'desc')
),
@ -311,7 +283,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="text" size="60" name="test/path" id="test/path" ' .
'class="custom field-error" value="val" />'
),
@ -319,7 +291,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<span class="field-comment-mark field-comment-warning" title="testComment">',
array('content' => 'i')
),
@ -327,7 +299,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<a class="restore-default" href="#test/path" ' .
'style="display:none">'
),
@ -338,9 +310,9 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
'<dl class="inline_errors"><dd>e1</dd></dl>',
$result
);
// second case
define('PMA_SETUP', true);
$GLOBALS['_FormDislayGroup'] = 0;
$GLOBALS['cfg']['ThemePath'] = 'themePath';
@ -351,7 +323,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
$opts['show_restore_default'] = true;
$opts['userprefs_comment'] = 'userprefsComment';
$opts['userprefs_allow'] = true;
ob_start();
PMA_displayInput(
'test/path', 'testName', 'checkbox', 'val',
@ -360,14 +332,14 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<tr class="group-field group-field-1">'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="checkbox" name="test/path" id="test/path" ' .
'checked="checked" />',
array(
@ -381,7 +353,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<a class="userprefs-comment" title="userprefsComment">',
array('child' => array('tag' => 'img'))
),
@ -389,11 +361,11 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<td class="userprefs-allow" title="Allow users to customize ' .
'this value">',
array(
'child' => $this->_getTagArray(
'child' => PMA_getTagArray(
'<input type="checkbox" name="test/path-userprefs-allow" ' .
'checked="checked"/>'
)
@ -403,7 +375,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<a class="set-value" href="#test/path=setVal" ' .
'title="Set value: setVal" style="display:none">',
array('child' => array('tag' => 'img'))
@ -425,7 +397,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="text" size="25" name="test/path" id="test/path" ' .
'value="val" />'
),
@ -441,13 +413,13 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="text" size="15" name="test/path" ' .
'id="test/path" value="val" />'
),
$result
);
// select case 1
$opts['values_escaped'] = true;
$opts['values_disabled'] = array(1, 2);
@ -463,21 +435,21 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<select name="test/path" id="test/path">'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<select name="test/path" id="test/path">'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<option value="1" selected="selected" disabled="disabled">',
array(
'parent' => array('tag' => 'select'),
@ -488,7 +460,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<option value="key1">',
array(
'parent' => array('tag' => 'select'),
@ -499,7 +471,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<option value="key2">',
array(
'parent' => array('tag' => 'select'),
@ -523,16 +495,16 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
'', true, $opts
);
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<select name="test/path" id="test/path">'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<select name="test/path" id="test/path">'
),
$result
@ -545,7 +517,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
// list
ob_start();
PMA_displayInput(
'test/path', 'testName', 'list', array('foo', 'bar'),
@ -554,7 +526,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<textarea cols="40" rows="5" name="test/path" id="test/path">',
array(
'content' => "foo\nbar"
@ -567,15 +539,15 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_displayGroupHeader()
*
*
* @return void
*/
public function testDisplayGroupHeader()
{
if (!function_exists('runkit_constant_remove')) {
if (! PMA_HAS_RUNKIT) {
$this->markTestSkipped('Cannot modify constant');
}
$this->assertNull(
PMA_displayGroupHeader('')
);
@ -591,10 +563,10 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<tr class="group-header group-header-4">',
array(
'child' => $this->_getTagArray(
'child' => PMA_getTagArray(
'<th colspan="3">',
array(
'content' => 'headerText'
@ -609,16 +581,16 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
runkit_constant_remove('PMA_SETUP');
$GLOBALS['_FormDisplayGroup'] = 3;
ob_start();
PMA_displayGroupHeader('headerText');
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<tr class="group-header group-header-4">',
array(
'child' => $this->_getTagArray(
'child' => PMA_getTagArray(
'<th colspan="2">',
array(
'content' => 'headerText'
@ -633,7 +605,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_displayGroupFooter()
*
*
* @return void
*/
public function testDisplayGroupFooter()
@ -648,17 +620,17 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_displayFieldsetBottom()
*
*
* @return void
*/
public function testDisplayFieldsetBottom()
{
if (!function_exists('runkit_constant_remove')) {
if (! PMA_HAS_RUNKIT) {
$this->markTestSkipped('Cannot modify constant');
}
// with PMA_SETUP
if (!defined('PMA_SETUP')) {
define('PMA_SETUP', true);
}
@ -668,14 +640,14 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<td colspan="3" class="lastrow">'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="submit" name="submit_save" value="Apply"',
array(
'parent' => array('tag' => 'td')
@ -685,7 +657,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="button" name="submit_reset" value="Reset" />',
array(
'parent' => array('tag' => 'td')
@ -700,7 +672,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
);
// without PMA_SETUP
runkit_constant_remove('PMA_SETUP');
ob_start();
@ -708,7 +680,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
$result = ob_get_clean();
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<td colspan="2" class="lastrow">'
),
$result
@ -717,7 +689,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_displayFieldsetBottomSimple()
*
*
* @return void
*/
public function testDisplayFieldsetBottomSimple()
@ -730,7 +702,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_displayTabsBottom()
*
*
* @return void
*/
public function testDisplayTabsBottom()
@ -743,7 +715,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_displayFormBottom()
*
*
* @return void
*/
public function testDisplayFormBottom()
@ -756,7 +728,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_addJsValidate()
*
*
* @return void
*/
public function testAddJsValidate()
@ -782,7 +754,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_displayJavascript()
*
*
* @return void
*/
public function testDisplayJavascript()
@ -795,7 +767,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
"<script type=\"text/javascript\">\n" .
"var i = 1;\n" .
"i++;\n" .
"</script>\n"
"</script>\n"
);
PMA_displayJavascript(array('var i = 1', 'i++'));
@ -803,7 +775,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_displayErrors()
*
*
* @return void
*/
public function testDisplayErrors()

View File

@ -29,6 +29,11 @@ class PMA_From_Processing_Test extends PHPUnit_Framework_TestCase
*/
public function testProcessFormSet()
{
if (!defined('PMA_TEST_HEADERS')) {
$this->markTestSkipped(
'Cannot redefine constant/function - missing runkit extension'
);
}
// case 1
$formDisplay = $this->getMockBuilder('FormDisplay')
@ -106,7 +111,7 @@ class PMA_From_Processing_Test extends PHPUnit_Framework_TestCase
process_formset($formDisplay);
$this->assertEquals(
'HTTP/1.1 303 See OtherLocation: index.php',
array('HTTP/1.1 303 See Other', 'Location: index.php'),
$GLOBALS['header']
);

View File

@ -312,7 +312,7 @@ class PMA_SetupIndex_Test extends PHPUnit_Framework_TestCase
*/
public function testCheckConfigRW()
{
if (!function_exists('runkit_constant_redefine')) {
if (! PMA_HAS_RUNKIT) {
$this->markTestSkipped('Cannot redefine constant');
}

View File

@ -46,7 +46,7 @@ class PMA_Tracker_Test extends PHPUnit_Framework_TestCase
if (!defined("PMA_DRIZZLE")) {
define("PMA_DRIZZLE", false);
} elseif (PMA_DRIZZLE) {
if (function_exists("runkit_constant_redefine")) {
if (PMA_HAS_RUNKIT) {
runkit_constant_redefine("PMA_DRIZZLE", false);
} else {
$this->markTestSkipped("Cannot redefine constant");
@ -63,7 +63,7 @@ class PMA_Tracker_Test extends PHPUnit_Framework_TestCase
*/
protected function tearDown()
{
if (function_exists("runkit_constant_redefine")) {
if (PMA_HAS_RUNKIT) {
runkit_constant_redefine("PMA_DRIZZLE", false);
}
}
@ -669,7 +669,7 @@ class PMA_Tracker_Test extends PHPUnit_Framework_TestCase
*/
public function testGetVersion()
{
if (!function_exists("runkit_constant_redefine")) {
if (! PMA_HAS_RUNKIT) {
$this->markTestSkipped("Cannot redefine constant");
}
@ -1050,7 +1050,7 @@ class PMA_Tracker_Test extends PHPUnit_Framework_TestCase
*/
public function testTransformTrackingSet()
{
if (!function_exists("runkit_constant_redefine")) {
if (! PMA_HAS_RUNKIT) {
$this->markTestSkipped("Cannot redefine constant");
}

View File

@ -33,9 +33,9 @@ class PMA_MySQL_Charsets_Test extends PHPUnit_Framework_TestCase
public function testGenerateCharsetQueryPart(
$drizzle, $collation, $expected
) {
if (! function_exists("runkit_constant_redefine")) {
if (! PMA_HAS_RUNKIT) {
$this->markTestSkipped(
'Cannot redefine constant/function - missing APD or/and runkit extension'
'Cannot redefine constant - missing runkit extension'
);
} else {
if (defined('PMA_DRIZZLE')) {
@ -75,9 +75,9 @@ class PMA_MySQL_Charsets_Test extends PHPUnit_Framework_TestCase
*/
public function testGetDbCollation()
{
if (! function_exists("runkit_constant_redefine")) {
if (! PMA_HAS_RUNKIT) {
$this->markTestSkipped(
'Cannot redefine constant/function - missing APD or/and runkit extension'
'Cannot redefine constant - missing runkit extension'
);
} else {
$GLOBALS['server'] = 1;

View File

@ -0,0 +1,187 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* tests for server_status_advisor.lib.php
*
* @package PhpMyAdmin-test
*/
/*
* Include to test.
*/
require_once 'libraries/Util.class.php';
require_once 'libraries/Advisor.class.php';
require_once 'libraries/php-gettext/gettext.inc';
require_once 'libraries/url_generating.lib.php';
require_once 'libraries/ServerStatusData.class.php';
require_once 'libraries/server_status_advisor.lib.php';
require_once 'libraries/Theme.class.php';
require_once 'libraries/database_interface.inc.php';
require_once 'libraries/Message.class.php';
require_once 'libraries/sanitizing.lib.php';
require_once 'libraries/sqlparser.lib.php';
require_once 'libraries/js_escape.lib.php';
/**
* class PMA_ServerStatusAdvisor_Test
*
* this class is for testing server_status_advisor.lib.php functions
*
* @package PhpMyAdmin-test
*/
class PMA_ServerStatusAdvisor_Test extends PHPUnit_Framework_TestCase
{
/**
* Prepares environment for the test.
*
* @return void
*/
public $ServerStatusData;
/**
* Test for setUp
*
* @return void
*/
public function setUp()
{
//$_REQUEST
$_REQUEST['log'] = "index1";
$_REQUEST['pos'] = 3;
//$GLOBALS
$GLOBALS['cfg']['MaxRows'] = 10;
$GLOBALS['cfg']['ServerDefault'] = "server";
$GLOBALS['cfg']['RememberSorting'] = true;
$GLOBALS['cfg']['SQP'] = array();
$GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 1000;
$GLOBALS['cfg']['ShowSQL'] = true;
$GLOBALS['cfg']['SQP']['fmtType'] = 'none';
$GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons';
$GLOBALS['cfg']['LimitChars'] = 100;
$GLOBALS['cfg']['DBG']['sql'] = false;
$GLOBALS['cfg']['Server']['host'] = "localhost";
$GLOBALS['cfg']['MySQLManualType'] = 'viewable';
$GLOBALS['cfg']['ShowHint'] = true;
$GLOBALS['cfg']['ActionLinksMode'] = 'icons';
$GLOBALS['PMA_PHP_SELF'] = PMA_getenv('PHP_SELF');
$GLOBALS['server_master_status'] = false;
$GLOBALS['server_slave_status'] = false;
$GLOBALS['table'] = "table";
$GLOBALS['pmaThemeImage'] = 'image';
//$_SESSION
$_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme');
$_SESSION['PMA_Theme'] = new PMA_Theme();
//Mock DBI
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')
->disableOriginalConstructor()
->getMock();
//this data is needed when PMA_ServerStatusData constructs
$server_status = array(
"Aborted_clients" => "0",
"Aborted_connects" => "0",
"Com_delete_multi" => "0",
"Com_create_function" => "0",
"Com_empty_query" => "0",
);
$server_variables= array(
"auto_increment_increment" => "1",
"auto_increment_offset" => "1",
"automatic_sp_privileges" => "ON",
"back_log" => "50",
"big_tables" => "OFF",
);
$fetchResult = array(
array(
"SHOW GLOBAL STATUS",
0,
1,
null,
0,
$server_status
),
array(
"SHOW GLOBAL VARIABLES",
0,
1,
null,
0,
$server_variables
),
array(
"SELECT concat('Com_', variable_name), variable_value "
. "FROM data_dictionary.GLOBAL_STATEMENTS",
0,
1,
null,
0,
$server_status
),
);
$dbi->expects($this->any())->method('fetchResult')
->will($this->returnValueMap($fetchResult));
$GLOBALS['dbi'] = $dbi;
$this->ServerStatusData = new PMA_ServerStatusData();
}
/**
* Test for PMA_getHTMLForAdvisor
*
* @return void
*/
public function testPMAGetHTMLForAdvisor()
{
//Call the test function
$html = PMA_getHTMLForAdvisor();
//validate 1: Advisor Instructions
$this->assertContains(
'<a href="#openAdvisorInstructions">',
$html
);
$this->assertContains(
'<div id="advisorInstructionsDialog"',
$html
);
//notice
$this->assertContains(
'The Advisor system can provide recommendations',
$html
);
$this->assertContains(
'Do note however that this system provides recommendations',
$html
);
//Advisor datas, we just validate that the Advisor Array is right
//Advisor logic related with OS should be validate on class Advisor
$this->assertContains(
'<div id="advisorData" style="display:none;">',
$html
);
//Advisor data Json encode Items
$this->assertContains(
htmlspecialchars(json_encode("parse")),
$html
);
$this->assertContains(
htmlspecialchars(json_encode("errors")),
$html
);
$this->assertContains(
htmlspecialchars(json_encode("run")),
$html
);
}
}

View File

@ -34,7 +34,7 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_userprefsPageInit
*
*
* @return void
*/
public function testUserPrefPageInit()
@ -50,8 +50,8 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
array('test' => 'val')
)
);
PMA_userprefsPageInit();
PMA_userprefsPageInit();
$this->assertEquals(
array(
@ -67,16 +67,16 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_loadUserprefs
*
*
* @return void
*/
public function testLoadUserprefs()
{
$_SESSION['relation'][$GLOBALS['server']]['userconfigwork'] = null;
unset($_SESSION['userconfig']);
$result = PMA_loadUserprefs();
$this->assertCount(
3,
$result
@ -104,7 +104,7 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
$_SESSION['relation'][$GLOBALS['server']]['userconfig'] = "testconf";
$_SESSION['relation'][$GLOBALS['server']]['user'] = "user";
$GLOBALS['controllink'] = null;
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')
->disableOriginalConstructor()
->getMock();
@ -149,9 +149,9 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
$GLOBALS['server'] = 2;
$_SESSION['relation'][2]['userconfigwork'] = null;
unset($_SESSION['userconfig']);
$result = PMA_saveUserprefs(array(1));
$this->assertTrue(
$result
);
@ -173,7 +173,7 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
);
$assert = true;
if (isset($_SESSION['cache']['server_2']['userprefs'])) {
$assert = false;
}
@ -198,7 +198,7 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
UPDATE `pmadb`.`testconf`
SET `config_data` = \'' . json_encode(array(1)) . '\'
WHERE `username` = \'user\'';
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')
->disableOriginalConstructor()
->getMock();
@ -219,7 +219,7 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
);
// case 3
$query1 = '
SELECT `username`
FROM `pmadb`.`testconf`
@ -229,7 +229,7 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
INSERT INTO `pmadb`.`testconf` (`username`, `config_data`)
VALUES (\'user\',
\'' . json_encode(array(1)) . '\')';
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')
->disableOriginalConstructor()
->getMock();
@ -248,11 +248,11 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
->method('getError')
->with(null)
->will($this->returnValue("err1"));
$GLOBALS['dbi'] = $dbi;
$result = PMA_saveUserprefs(array(1));
$this->assertEquals(
'Could not save configuration <br /><br /> err1',
$result->getMessage()
@ -261,7 +261,7 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_applyUserprefs
*
*
* @return void
*/
public function testApplyUserprefs()
@ -293,7 +293,7 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_readUserprefsFieldNames
*
*
* @return void
*/
public function testReadUserprefsFieldNames()
@ -318,7 +318,7 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_persistOption
*
*
* @return void
*/
public function testPersistOption()
@ -333,7 +333,7 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
$GLOBALS['server'] = 2;
$_SESSION['relation'][2]['userconfigwork'] = null;
$this->assertNull(
PMA_persistOption('Server/hide_db', 'val', 'val')
);
@ -349,13 +349,15 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_userprefsRedirect
*
*
* @return void
*/
public function testUserprefsRedirect()
{
if (!function_exists('runkit_constant_redefine')) {
$this->markTestSkipped('Cannot redefine constant');
if (!defined('PMA_TEST_HEADERS')) {
$this->markTestSkipped(
'Cannot redefine constant/function - missing runkit extension'
);
}
$GLOBALS['cfg']['PmaAbsoluteUri'] = 'http://www.phpmyadmin.net';
@ -379,7 +381,7 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
$this->assertContains(
'Location: http://www.phpmyadmin.netfile.html?a=b&saved=1&server=0&' .
'token=token#h+ash',
$GLOBALS['header']
$GLOBALS['header'][0]
);
if ($redefine !== null) {
@ -391,7 +393,7 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
/**
* Test for PMA_userprefsAutoloadGetHeader
*
*
* @return void
*/
public function testUserprefsAutoloadGetHeader()
@ -414,35 +416,35 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
$result = PMA_userprefsAutoloadGetHeader();
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<form action="prefs_manage.php" method="post">'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="hidden" name="token" value="token"'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="hidden" name="json" value="" />'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="hidden" name="submit_import" value="1" />'
),
$result
);
$this->assertTag(
$this->_getTagArray(
PMA_getTagArray(
'<input type="hidden" name="return_url" value="phpunit?" />'
),
$result
@ -452,10 +454,10 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
/**
* Return the tag array to be used with assertTag by parsing
* a given HTML element
*
*
* @param string $elementHTML HTML for element to be parsed
* @param array $arr Additional array elements like content, parent
*
*
* @return array Tag array to be used with assertTag
*/
private function _getTagArray($elementHTML, $arr = array())

View File

@ -22,12 +22,11 @@ class PMA_WhichCrlf_Test extends PHPUnit_Framework_TestCase
*/
public function testWhichCrlf()
{
$runkit = function_exists('runkit_constant_redefine');
if ($runkit && defined('PMA_USR_OS')) {
if (PMA_HAS_RUNKIT && defined('PMA_USR_OS')) {
$pma_usr_os = PMA_USR_OS;
}
if (defined('PMA_USR_OS') && !$runkit) {
if (defined('PMA_USR_OS') && !PMA_HAS_RUNKIT) {
if (PMA_USR_OS == 'Win') {
$this->assertEquals(
@ -43,7 +42,7 @@ class PMA_WhichCrlf_Test extends PHPUnit_Framework_TestCase
} else {
if ($runkit) {
if (PMA_HAS_RUNKIT) {
if (!defined('PMA_USR_OS')) {
define('PMA_USR_OS', 'Linux');
} else {
@ -55,7 +54,7 @@ class PMA_WhichCrlf_Test extends PHPUnit_Framework_TestCase
);
}
if ($runkit) {
if (PMA_HAS_RUNKIT) {
runkit_constant_redefine('PMA_USR_OS', 'Win');
} else {
define('PMA_USR_OS', 'Win');
@ -66,7 +65,7 @@ class PMA_WhichCrlf_Test extends PHPUnit_Framework_TestCase
}
if ($runkit) {
if (PMA_HAS_RUNKIT) {
if (isset($pma_usr_os)) {
runkit_constant_redefine('PMA_USR_OS', 'Win');
} else {

View File

@ -50,110 +50,12 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase
protected $runkitExt;
protected $apdExt;
public function __construct()
{
parent::__construct();
$this->runkitExt = false;
if (function_exists("runkit_constant_redefine")) {
$this->runkitExt = true;
}
$this->apdExt = false;
if (function_exists("rename_function")) {
$this->apdExt = true;
}
if ($this->apdExt && !$GLOBALS['test_header']) {
/*
* using apd extension to overriding header and headers_sent
* functions for test purposes
*/
$GLOBALS['test_header'] = 1;
/*
* rename_function() of header and headers_sent may cause CLI error
* report in Windows XP
*/
rename_function('header', 'test_header');
rename_function('headers_sent', 'test_headers_sent');
/*
* solution from:
* http://unixwars.com/2008/11/29/override_function-in-php/
* to overriding more than one function
*/
$substs = array(
'header' =>
'if (isset($GLOBALS["header"])) {'
. '$GLOBALS["header"] .= $a;'
. '} else {'
. '$GLOBALS["header"] = $a;'
. '}',
'headers_sent' => 'return false;'
);
$args = array(
'header' => '$a',
'headers_sent' => ''
);
foreach ($substs as $func => $ren_func) {
if (function_exists("__overridden__")) {
rename_function(
"__overridden__",
str_replace(
array('.', ' '),
array('', ''),
microtime()
)
);
}
override_function($func, $args[$func], $substs[$func]);
rename_function(
"__overridden__",
str_replace(array('.', ' '), array('', ''), microtime())
);
}
}
}
public function __destruct()
{
/*
* rename_function may causes CLI error report in Windows XP, but
* nothing more happen
*/
if ($this->apdExt && $GLOBALS['test_header']) {
$GLOBALS['test_header'] = 0;
rename_function(
'header',
'header' . str_replace(
array('.', ' '), array('', ''), microtime()
)
);
rename_function(
'headers_sent',
'headers_sent' . str_replace(
array('.', ' '), array('', ''), microtime()
)
);
rename_function('test_header', 'header');
rename_function('test_headers_sent', 'headers_sent');
}
}
public function setUp()
{
//session_start();
// cleaning constants
if ($this->runkitExt) {
if (PMA_HAS_RUNKIT) {
$this->oldIISvalue = 'non-defined';
@ -189,7 +91,7 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase
//session_destroy();
// cleaning constants
if ($this->runkitExt) {
if (PMA_HAS_RUNKIT) {
if ($this->oldIISvalue != 'non-defined') {
runkit_constant_redefine('PMA_IS_IIS', $this->oldIISvalue);
@ -203,23 +105,19 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase
runkit_constant_remove('SID');
}
}
if ($this->apdExt) {
unset($GLOBALS['header']);
}
}
public function testSendHeaderLocationWithSidUrlWithQuestionMark()
{
if ($this->runkitExt && $this->apdExt) {
if (defined('PMA_TEST_HEADERS')) {
runkit_constant_redefine('SID', md5('test_hash'));
$testUri = 'http://testurl.com/test.php?test=test';
$separator = PMA_get_arg_separator();
$header = 'Location: ' . $testUri . $separator . SID;
$header = array('Location: ' . $testUri . $separator . SID);
/* sets $GLOBALS['header'] */
PMA_sendHeaderLocation($testUri);
@ -228,7 +126,7 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase
} else {
$this->markTestSkipped(
'Cannot redefine constant/function - missing APD or/and runkit extension'
'Cannot redefine constant/function - missing runkit extension'
);
}
@ -236,74 +134,74 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase
public function testSendHeaderLocationWithSidUrlWithoutQuestionMark()
{
if ($this->runkitExt && $this->apdExt) {
if (defined('PMA_TEST_HEADERS')) {
runkit_constant_redefine('SID', md5('test_hash'));
$testUri = 'http://testurl.com/test.php';
$separator = PMA_get_arg_separator();
$header = 'Location: ' . $testUri . '?' . SID;
$header = array('Location: ' . $testUri . '?' . SID);
PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header']
$this->assertEquals($header, $GLOBALS['header']);
} else {
$this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension');
$this->markTestSkipped('Cannot redefine constant/function - missing runkit extension');
}
}
public function testSendHeaderLocationWithoutSidWithIis()
{
if ($this->runkitExt && $this->apdExt) {
if (defined('PMA_TEST_HEADERS')) {
runkit_constant_redefine('PMA_IS_IIS', true);
$testUri = 'http://testurl.com/test.php';
$separator = PMA_get_arg_separator();
$header = 'Location: ' . $testUri;
$header = array('Location: ' . $testUri);
PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header']
$this->assertEquals($header, $GLOBALS['header']);
//reset $GLOBALS['header'] for the next assertion
unset($GLOBALS['header']);
$header = 'Refresh: 0; ' . $testUri;
$header = array('Refresh: 0; ' . $testUri);
PMA_sendHeaderLocation($testUri, true); // sets $GLOBALS['header']
$this->assertEquals($header, $GLOBALS['header']);
} else {
$this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension');
$this->markTestSkipped('Cannot redefine constant/function - missing runkit extension');
}
}
public function testSendHeaderLocationWithoutSidWithoutIis()
{
if ($this->apdExt) {
if (defined('PMA_TEST_HEADERS')) {
$testUri = 'http://testurl.com/test.php';
$header = 'Location: ' . $testUri;
$header = array('Location: ' . $testUri);
PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header']
$this->assertEquals($header, $GLOBALS['header']);
} else {
$this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension');
$this->markTestSkipped('Cannot redefine constant/function - missing runkit extension');
}
}
public function testSendHeaderLocationIisLongUri()
{
if (defined('PMA_IS_IIS') && $this->runkitExt) {
if (defined('PMA_IS_IIS') && PMA_HAS_RUNKIT) {
runkit_constant_redefine('PMA_IS_IIS', true);
} elseif (!defined('PMA_IS_IIS')) {
define('PMA_IS_IIS', true);
} else {
$this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension');
$this->markTestSkipped('Cannot redefine constant/function - missing runkit extension');
}
// over 600 chars

View File

@ -953,6 +953,10 @@ div#tablestatistics table {
float: <?php echo $left; ?>;
}
#fieldset_user_group_rights fieldset {
float: <?php echo $left; ?>;
}
#fieldset_user_global_rights legend input {
margin-<?php echo $left; ?>: 2em;
}

View File

@ -1207,6 +1207,10 @@ div#tablestatistics table {
float: <?php echo $left; ?>;
}
#fieldset_user_group_rights fieldset {
float: <?php echo $left; ?>;
}
#fieldset_user_global_rights legend input {
margin-<?php echo $left; ?>: 2em;
}