diff --git a/server_privileges.php b/server_privileges.php index 24fa965d4..c7fcb2605 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -46,10 +46,11 @@ if (isset($dbname)) { if (!$is_superuser) { require './libraries/server_links.inc.php'; echo '

' . "\n" - . ($GLOBALS['cfg']['MainPageIconic'] ? '' : '') + . PMA_getIcon('b_usrlist.png') . $GLOBALS['strPrivileges'] . "\n" - . '

' . "\n" - . $GLOBALS['strNoPrivileges'] . "\n"; + . '' . "\n"; + $message = new PMA_Message('strNoPrivileges', PMA_Message::ERROR); + $message->display(); require_once './libraries/footer.inc.php'; } @@ -59,9 +60,10 @@ if (!$is_superuser) { * @param string the user's initial * @return string the generated condition */ -function PMA_RangeOfUsers($initial = '') { -// strtolower() is used because the User field -// might be BINARY, so LIKE would be case sensitive +function PMA_RangeOfUsers($initial = '') +{ + // strtolower() is used because the User field + // might be BINARY, so LIKE would be case sensitive if (!empty($initial)) { $ret = " WHERE " . PMA_convert_using('User') . " LIKE " . PMA_convert_using($initial . '%', 'quoted') @@ -94,7 +96,7 @@ function PMA_extractPrivInfo($row = '', $enableHTML = FALSE) array('Drop_priv', 'DROP', $GLOBALS['strPrivDescDropDb']), array('Reload_priv', 'RELOAD', $GLOBALS['strPrivDescReload']), array('Shutdown_priv', 'SHUTDOWN', $GLOBALS['strPrivDescShutdown']), - array('Process_priv', 'PROCESS', $GLOBALS['strPrivDescProcess' . ((!empty($row) && isset($row['Super_priv'])) || (empty($row) && isset($GLOBALS['Super_priv'])) ? '4' : '3')]), + array('Process_priv', 'PROCESS', $GLOBALS['strPrivDescProcess4']), array('File_priv', 'FILE', $GLOBALS['strPrivDescFile']), array('References_priv', 'REFERENCES', $GLOBALS['strPrivDescReferences']), array('Index_priv', 'INDEX', $GLOBALS['strPrivDescIndex']), @@ -106,6 +108,8 @@ function PMA_extractPrivInfo($row = '', $enableHTML = FALSE) array('Repl_slave_priv', 'REPLICATION SLAVE', $GLOBALS['strPrivDescReplSlave']), array('Repl_client_priv', 'REPLICATION CLIENT', $GLOBALS['strPrivDescReplClient']), array('Create_view_priv', 'CREATE VIEW', $GLOBALS['strPrivDescCreateView']), + array('Event_priv', 'EVENT', $GLOBALS['strPrivDescEvent']), + array('Trigger_priv', 'TRIGGER', $GLOBALS['strPrivDescTrigger']), // for table privs: array('Create View_priv', 'CREATE VIEW', $GLOBALS['strPrivDescCreateView']), array('Show_view_priv', 'SHOW VIEW', $GLOBALS['strPrivDescShowView']), @@ -136,14 +140,23 @@ function PMA_extractPrivInfo($row = '', $enableHTML = FALSE) $privs = array(); $allPrivileges = TRUE; foreach ($grants as $current_grant) { - if ((!empty($row) && isset($row[$current_grant[0]])) || (empty($row) && isset($GLOBALS[$current_grant[0]]))) { - if ((!empty($row) && $row[$current_grant[0]] == 'Y') || (empty($row) && ($GLOBALS[$current_grant[0]] == 'Y' || (is_array($GLOBALS[$current_grant[0]]) && count($GLOBALS[$current_grant[0]]) == $GLOBALS['column_count'] && empty($GLOBALS[$current_grant[0] . '_none']))))) { + if ((!empty($row) && isset($row[$current_grant[0]])) + || (empty($row) && isset($GLOBALS[$current_grant[0]]))) { + if ((!empty($row) && $row[$current_grant[0]] == 'Y') + || (empty($row) + && ($GLOBALS[$current_grant[0]] == 'Y' + || (is_array($GLOBALS[$current_grant[0]]) + && count($GLOBALS[$current_grant[0]]) == $GLOBALS['column_count'] + && empty($GLOBALS[$current_grant[0] . '_none']))))) + { if ($enableHTML) { $privs[] = '' . $current_grant[1] . ''; } else { $privs[] = $current_grant[1]; } - } elseif (!empty($GLOBALS[$current_grant[0]]) && is_array($GLOBALS[$current_grant[0]]) && empty($GLOBALS[$current_grant[0] . '_none'])) { + } elseif (!empty($GLOBALS[$current_grant[0]]) + && is_array($GLOBALS[$current_grant[0]]) + && empty($GLOBALS[$current_grant[0] . '_none'])) { if ($enableHTML) { $priv_string = '' . $current_grant[1] . ''; } else { @@ -171,52 +184,56 @@ function PMA_extractPrivInfo($row = '', $enableHTML = FALSE) return $privs; } // end of the 'PMA_extractPrivInfo()' function - /** * Displays on which column(s) a table-specific privilege is granted */ -function PMA_display_column_privs($spaces, $columns, $row, $name_for_select, $priv_for_header, $name, $name_for_dfn, $name_for_current) { - - echo $spaces . '
' . "\n" - . $spaces . ' ' . "\n" - . $spaces . ' ' . "\n"; foreach ($columns as $current_column => $current_column_privileges) { - echo $spaces . ' ' . "\n"; } - echo $spaces . ' ' . "\n" - . $spaces . ' ' . $GLOBALS['strOr'] . '' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '
' . "\n"; + echo ' ' . "\n" + . ' ' . $GLOBALS['strOr'] . '' . "\n" + . ' ' . "\n" + . ' ' . "\n"; } // end function + /** * Displays the privileges form table * * @param string $db the database * @param string $table the table * @param boolean $submit wheather to display the submit button or not - * @param int $indent the indenting level of the code - * * @global array $cfg the phpMyAdmin configuration * @global ressource $user_link the database connection * * @return void */ -function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = 0) +function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE) { if ($db == '*') { $table = '*'; } - $spaces = str_repeat(' ', $indent); if (isset($GLOBALS['username'])) { $username = $GLOBALS['username']; @@ -333,27 +350,32 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = PMA_DBI_free_result($res); unset($res, $row1, $current); - echo $spaces . '' . "\n" - . $spaces . '' . "\n" - . $spaces . '
' . "\n" - . $spaces . ' ' . $GLOBALS['strTblPrivileges'] . '' . "\n" - . $spaces . '

' . $GLOBALS['strEnglishPrivileges'] . '

' . "\n"; + echo '' . "\n" + . '' . "\n" + . '
' . "\n" + . ' ' . $GLOBALS['strTblPrivileges'] . '' . "\n" + . '

' . $GLOBALS['strEnglishPrivileges'] . '

' . "\n"; // privs that are attached to a specific column - PMA_display_column_privs($spaces, $columns, $row, 'Select_priv', 'SELECT', 'select', $GLOBALS['strPrivDescSelect'], 'Select'); + PMA_display_column_privs($columns, $row, 'Select_priv', + 'SELECT', 'select', $GLOBALS['strPrivDescSelect'], 'Select'); - PMA_display_column_privs($spaces, $columns, $row, 'Insert_priv', 'INSERT', 'insert', $GLOBALS['strPrivDescInsert'], 'Insert'); + PMA_display_column_privs($columns, $row, 'Insert_priv', + 'INSERT', 'insert', $GLOBALS['strPrivDescInsert'], 'Insert'); - PMA_display_column_privs($spaces, $columns, $row, 'Update_priv', 'UPDATE', 'update', $GLOBALS['strPrivDescUpdate'], 'Update'); + PMA_display_column_privs($columns, $row, 'Update_priv', + 'UPDATE', 'update', $GLOBALS['strPrivDescUpdate'], 'Update'); - PMA_display_column_privs($spaces, $columns, $row, 'References_priv', 'REFERENCES', 'references', $GLOBALS['strPrivDescReferences'], 'References'); + PMA_display_column_privs($columns, $row, 'References_priv', + 'REFERENCES', 'references', $GLOBALS['strPrivDescReferences'], 'References'); // privs that are not attached to a specific column - echo $spaces . '
' . "\n"; + echo '
' . "\n"; foreach ($row as $current_grant => $current_grant_value) { - if (in_array(substr($current_grant, 0, (strlen($current_grant) - 5)), array('Select', 'Insert', 'Update', 'References'))) { + if (in_array(substr($current_grant, 0, (strlen($current_grant) - 5)), + array('Select', 'Insert', 'Update', 'References'))) { continue; } // make a substitution to match the messages variables; @@ -370,18 +392,30 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = $tmp_current_grant = $current_grant; } - echo $spaces . '
' . "\n" - . $spaces . ' ' . "\n" + . ' ' . "\n"; + echo (isset($GLOBALS['strPrivDesc' . substr($tmp_current_grant, 0, (strlen($tmp_current_grant) - 5))]) + ? $GLOBALS['strPrivDesc' . substr($tmp_current_grant, 0, (strlen($tmp_current_grant) - 5))] + : $GLOBALS['strPrivDesc' . substr($tmp_current_grant, 0, (strlen($tmp_current_grant) - 5)) . 'Tbl']) . '"/>' . "\n"; - echo $spaces . ' ' . "\n" - . $spaces . '
' . "\n"; + echo ' ' . "\n" + . '
' . "\n"; } // end foreach () - echo $spaces . '
' . "\n"; + echo ' ' . "\n"; // for Safari 2.0.2 - echo $spaces . '
' . "\n"; + echo '
' . "\n"; } else { @@ -403,11 +437,13 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = array('Create', 'CREATE', ($table == '*' ? $GLOBALS['strPrivDescCreateDb'] : $GLOBALS['strPrivDescCreateTbl'])), array('Alter', 'ALTER', $GLOBALS['strPrivDescAlter']), array('Index', 'INDEX', $GLOBALS['strPrivDescIndex']), - array('Drop', 'DROP', ($table == '*' ? $GLOBALS['strPrivDescDropDb'] : $GLOBALS['strPrivDescDropTbl'])) + array('Drop', 'DROP', ($table == '*' ? $GLOBALS['strPrivDescDropDb'] : $GLOBALS['strPrivDescDropTbl'])), + array('Create_tmp_table', 'CREATE TEMPORARY TABLES', $GLOBALS['strPrivDescCreateTmpTable']), + array('Show_view', 'SHOW VIEW', $GLOBALS['strPrivDescShowView']), + array('Create_routine', 'CREATE ROUTINE', $GLOBALS['strPrivDescCreateRoutine']), + array('Alter_routine', 'ALTER ROUTINE', $GLOBALS['strPrivDescAlterRoutine']), + array('Execute', 'EXECUTE', $GLOBALS['strPrivDescExecute5']), ); - if (isset($row['Create_tmp_table_priv'])) { - $privTable[1][] = array('Create_tmp_table', 'CREATE TEMPORARY TABLES', $GLOBALS['strPrivDescCreateTmpTable']); - } // this one is for a db-specific priv: Create_view_priv if (isset($row['Create_view_priv'])) { $privTable[1][] = array('Create_view', 'CREATE VIEW', $GLOBALS['strPrivDescCreateView']); @@ -416,125 +452,140 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = if (isset($row['Create View_priv'])) { $privTable[1][] = array('Create View', 'CREATE VIEW', $GLOBALS['strPrivDescCreateView']); } - if (isset($row['Show_view_priv'])) { - $privTable[1][] = array('Show_view', 'SHOW VIEW', $GLOBALS['strPrivDescShowView']); - } - if (isset($row['Create_routine_priv'])) { - $privTable[1][] = array('Create_routine', 'CREATE ROUTINE', $GLOBALS['strPrivDescCreateRoutine']); - } - if (isset($row['Alter_routine_priv'])) { - $privTable[1][] = array('Alter_routine', 'ALTER ROUTINE', $GLOBALS['strPrivDescAlterRoutine']); - } - if (isset($row['Execute_priv'])) { - $privTable[1][] = array('Execute', 'EXECUTE', $GLOBALS['strPrivDescExecute5']); + if (isset($row['Event_priv'])) { + // MySQL 5.1.6 + $privTable[1][] = array('Event', 'EVENT', $GLOBALS['strPrivDescEvent']); + $privTable[1][] = array('Trigger', 'TRIGGER', $GLOBALS['strPrivDescTrigger']); } // a d m i n i s t r a t i o n - $privTable[2] = array(); - if (isset($row['Grant_priv'])) { - $privTable[2][] = array('Grant', 'GRANT', $GLOBALS['strPrivDescGrant']); - } + $privTable[2] = array( + array('Grant', 'GRANT', $GLOBALS['strPrivDescGrant']), + ); if ($db == '*') { - if (isset($row['Super_priv'])) { - $privTable[2][] = array('Super', 'SUPER', $GLOBALS['strPrivDescSuper']); - $privTable[2][] = array('Process', 'PROCESS', $GLOBALS['strPrivDescProcess4']); - } else { - $privTable[2][] = array('Process', 'PROCESS', $GLOBALS['strPrivDescProcess3']); - } + $privTable[2][] = array('Super', 'SUPER', $GLOBALS['strPrivDescSuper']); + $privTable[2][] = array('Process', 'PROCESS', $GLOBALS['strPrivDescProcess4']); $privTable[2][] = array('Reload', 'RELOAD', $GLOBALS['strPrivDescReload']); $privTable[2][] = array('Shutdown', 'SHUTDOWN', $GLOBALS['strPrivDescShutdown']); - if (isset($row['Show_db_priv'])) { - $privTable[2][] = array('Show_db', 'SHOW DATABASES', $GLOBALS['strPrivDescShowDb']); - } - } - if (isset($row['Lock_tables_priv'])) { - $privTable[2][] = array('Lock_tables', 'LOCK TABLES', $GLOBALS['strPrivDescLockTables']); + $privTable[2][] = array('Show_db', 'SHOW DATABASES', $GLOBALS['strPrivDescShowDb']); } + $privTable[2][] = array('Lock_tables', 'LOCK TABLES', $GLOBALS['strPrivDescLockTables']); $privTable[2][] = array('References', 'REFERENCES', $GLOBALS['strPrivDescReferences']); if ($db == '*') { - //if (isset($row['Execute_priv'])) { - // $privTable[2][] = array('Execute', 'EXECUTE', $GLOBALS['strPrivDescExecute']); - //} - if (isset($row['Repl_client_priv'])) { - $privTable[2][] = array('Repl_client', 'REPLICATION CLIENT', $GLOBALS['strPrivDescReplClient']); - } - if (isset($row['Repl_slave_priv'])) { - $privTable[2][] = array('Repl_slave', 'REPLICATION SLAVE', $GLOBALS['strPrivDescReplSlave']); - } - if (isset($row['Create_user_priv'])) { - $privTable[2][] = array('Create_user', 'CREATE USER', $GLOBALS['strPrivDescCreateUser']); - } + $privTable[2][] = array('Repl_client', 'REPLICATION CLIENT', $GLOBALS['strPrivDescReplClient']); + $privTable[2][] = array('Repl_slave', 'REPLICATION SLAVE', $GLOBALS['strPrivDescReplSlave']); + $privTable[2][] = array('Create_user', 'CREATE USER', $GLOBALS['strPrivDescCreateUser']); } - echo $spaces . '' . "\n" - . $spaces . '
' . "\n" - . $spaces . ' ' . "\n" - . $spaces . ' ' . ($db == '*' ? $GLOBALS['strGlobalPrivileges'] : ($table == '*' ? $GLOBALS['strDbPrivileges'] : $GLOBALS['strTblPrivileges'])) . "\n" - . $spaces . ' (' . $GLOBALS['strCheckAll'] . ' /' . "\n" - . $spaces . ' ' . $GLOBALS['strUncheckAll'] . ')' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '

' . $GLOBALS['strEnglishPrivileges'] . '

' . "\n" - . $spaces . '
' . "\n" - . $spaces . ' ' . $GLOBALS['strData'] . '' . "\n"; + echo '' . "\n" + . '
' . "\n" + . ' ' . "\n" + . ' ' + . ($db == '*' + ? $GLOBALS['strGlobalPrivileges'] + : ($table == '*' + ? $GLOBALS['strDbPrivileges'] + : $GLOBALS['strTblPrivileges'])) . "\n" + . ' (' + . $GLOBALS['strCheckAll'] . ' /' . "\n" + . ' ' + . $GLOBALS['strUncheckAll'] . ')' . "\n" + . ' ' . "\n" + . '

' . $GLOBALS['strEnglishPrivileges'] . '

' . "\n" + . '
' . "\n" + . ' ' . $GLOBALS['strData'] . '' . "\n"; foreach ($privTable[0] as $priv) { - echo $spaces . '
' . "\n" - . $spaces . ' ' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '
' . "\n"; + echo '
' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . '
' . "\n"; } - echo $spaces . '
' . "\n" - . $spaces . '
' . "\n" - . $spaces . ' ' . $GLOBALS['strStructure'] . '' . "\n"; + echo '
' . "\n" + . '
' . "\n" + . ' ' . $GLOBALS['strStructure'] . '' . "\n"; foreach ($privTable[1] as $priv) { - echo $spaces . '
' . "\n" - . $spaces . ' ' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '
' . "\n"; + echo '
' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . '
' . "\n"; } - echo $spaces . '
' . "\n" - . $spaces . '
' . "\n" - . $spaces . ' ' . $GLOBALS['strAdministration'] . '' . "\n"; + echo '
' . "\n" + . '
' . "\n" + . ' ' . $GLOBALS['strAdministration'] . '' . "\n"; foreach ($privTable[2] as $priv) { - echo $spaces . '
' . "\n" - . $spaces . ' ' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '
' . "\n"; + echo '
' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . '
' . "\n"; } - echo $spaces . '
' . "\n"; + echo '
' . "\n"; // The "Resource limits" box is not displayed for db-specific privs if ($db == '*') { - echo $spaces . '
' . "\n" - . $spaces . ' ' . $GLOBALS['strResourceLimits'] . '' . "\n" - . $spaces . '

' . $GLOBALS['strZeroRemovesTheLimit'] . '

' . "\n" - . $spaces . '
' . "\n" - . $spaces . ' ' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '
' . "\n" - . $spaces . '
' . "\n" - . $spaces . ' ' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '
' . "\n" - . $spaces . '
' . "\n" - . $spaces . ' ' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '
' . "\n" - . $spaces . '
' . "\n" - . $spaces . ' ' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '
' . "\n" - . $spaces . '
' . "\n"; + echo '
' . "\n" + . ' ' . $GLOBALS['strResourceLimits'] . '' . "\n" + . '

' . $GLOBALS['strZeroRemovesTheLimit'] . '

' . "\n" + . '
' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . '
' . "\n" + . '
' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . '
' . "\n" + . '
' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . '
' . "\n" + . '
' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . '
' . "\n" + . '
' . "\n"; } // for Safari 2.0.2 - echo $spaces . '
' . "\n"; + echo '
' . "\n"; } - echo $spaces . '
' . "\n"; + echo '
' . "\n"; if ($submit) { - echo $spaces . '' . "\n"; + echo '' . "\n"; } } // end of the 'PMA_displayPrivTable()' function @@ -545,16 +596,13 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = * * @param string $mode are we creating a new user or are we just * changing one? (allowed values: 'new', 'change') - * @param int $indent the indenting level of the code - * * @global array $cfg the phpMyAdmin configuration * @global ressource $user_link the database connection * * @return void */ -function PMA_displayLoginInformationFields($mode = 'new', $indent = 0) { - $spaces = str_repeat(' ', $indent); - +function PMA_displayLoginInformationFields($mode = 'new') +{ // Get user/host name lengths $fields_info = PMA_DBI_get_fields('mysql', 'user'); $username_length = 16; @@ -579,27 +627,34 @@ function PMA_displayLoginInformationFields($mode = 'new', $indent = 0) { if (isset($GLOBALS['username']) && strlen($GLOBALS['username']) === 0) { $GLOBALS['pred_username'] = 'any'; } - echo $spaces . '
' . "\n" - . $spaces . '' . $GLOBALS['strLoginInformation'] . '' . "\n" - . $spaces . '
' . "\n" - . $spaces . '' . "\n" - . $spaces . '' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '' . "\n" - . $spaces . '' . "\n" - . $spaces . '
' . "\n" - . $spaces . '
' . "\n" - . $spaces . '' . "\n" - . $spaces . '' . "\n" - . $spaces . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . '' . "\n" + . '' . "\n" + . '
' . "\n" + . '
' . "\n" + . '' . "\n" + . '' . "\n" + . ' ' . "\n" - . $spaces . '' . "\n" - . $spaces . '' . "\n" - . $spaces . '
' . "\n" - . $spaces . '
' . "\n" - . $spaces . '' . "\n" - . $spaces . '' . "\n" - . $spaces . ' ' . "\n" + . '' . "\n" + . '' . "\n" + . '
' . "\n" + . '
' . "\n" + . '' . "\n" + . '' . "\n" + . ' ' . "\n" - . $spaces . '' . "\n" - . $spaces . '' . "\n" - . $spaces . '
' . "\n" - . $spaces . '
' . "\n" - . $spaces . '' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '' . "\n" - . $spaces . '
' . "\n" - . $spaces . '
' . "\n" - . $spaces . '' . "\n" - . $spaces . '' . "\n" - . $spaces . ' ' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '' . "\n" - . $spaces . '' . "\n" - . $spaces . '
' . "\n" - . $spaces . '
' . "\n"; + echo '>' . $GLOBALS['strNoPassword'] . '' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . '' . "\n" + . '' . "\n" + . '' . "\n" + . '
' . "\n" + . '' . "\n" + . ' ' . "\n" + . '' . "\n" + . '
' . "\n" + . '
' . "\n" + . '' . "\n" + . '' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . '' . "\n" + . '' . "\n" + . '
' . "\n" + . '
' . "\n"; } // end of the 'PMA_displayUserAndHostFields()' function @@ -1196,29 +1271,21 @@ if (isset($viewing_mode) && $viewing_mode == 'db') { * defines some standard links */ $link_edit = ''; -if ($GLOBALS['cfg']['PropertiesIconic']) { - $link_edit .= '' . $GLOBALS['strEditPrivileges'] . ''; -} else { - $link_edit .= $GLOBALS['strEditPrivileges']; -} -$link_edit .= ''; + . '&username=%s' + . '&hostname=%s' + . '&dbname=%s' + . '&tablename=%s">' + . PMA_getIcon('b_usredit.png', $GLOBALS['strEditPrivileges']) + . ''; $link_revoke = ''; -if ($GLOBALS['cfg']['PropertiesIconic']) { - $link_revoke .= '' . $GLOBALS['strRevoke'] . ''; -} else { - $link_revoke .= $GLOBALS['strRevoke']; -} -$link_revoke .= ''; + . '&username=%s' + . '&hostname=%s' + . '&dbname=%s' + . '&tablename=%s' + . '&revokeall=1">' + . PMA_getIcon('b_usrdrop.png', $GLOBALS['strRevoke']) + . ''; /** * Displays the page @@ -1227,40 +1294,13 @@ if (empty($adduser) && (! isset($checkprivs) || ! strlen($checkprivs))) { if (! isset($username)) { // No username is given --> display the overview echo '

' . "\n" - . ($GLOBALS['cfg']['MainPageIconic'] ? '' : '') + . PMA_getIcon('b_usrlist.png') . $GLOBALS['strUserOverview'] . "\n" . '

' . "\n"; $sql_query = - 'SELECT `User`,' . - ' `Host`,' . - " IF(`Password` = _latin1 '', 'N', 'Y') AS 'Password'," . - ' `Select_priv`,' . - ' `Insert_priv`,' . - ' `Update_priv`,' . - ' `Delete_priv`,' . - ' `Index_priv`,' . - ' `Alter_priv`,' . - ' `Create_priv`,' . - ' `Drop_priv`,' . - ' `Grant_priv`,' . - ' `References_priv`,' . - ' `Reload_priv`,' . - ' `Shutdown_priv`,' . - ' `Process_priv`,' . - ' `File_priv`,' . - ' `Show_db_priv`,' . - ' `Super_priv`,' . - ' `Create_tmp_table_priv`,' . - ' `Lock_tables_priv`,' . - ' `Execute_priv`,' . - ' `Repl_slave_priv`,' . - ' `Repl_client_priv`,' . - ' `Create_view_priv`,' . - ' `Show_view_priv`,' . - ' `Create_user_priv`,' . - ' `Create_routine_priv`,' . - ' `Alter_routine_priv`' . + 'SELECT *,' . + " IF(`Password` = _latin1 '', 'N', 'Y') AS 'Password'" . ' FROM `mysql`.`user`'; $sql_query .= (isset($initial) ? PMA_RangeOfUsers($initial) : ''); @@ -1380,7 +1420,7 @@ if (empty($adduser) && (! isset($checkprivs) || ! strlen($checkprivs))) { unset($res); echo '
' . "\n" - . PMA_generate_common_hidden_inputs('', '', 1) + . PMA_generate_common_hidden_inputs('', '') . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" @@ -1402,7 +1442,12 @@ if (empty($adduser) && (! isset($checkprivs) || ! strlen($checkprivs))) { foreach ($user as $host) { $index_checkbox++; echo ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' . "\n"; echo '
' . htmlspecialchars($host['Host']) . ''; @@ -1449,12 +1494,12 @@ if (empty($adduser) && (! isset($checkprivs) || ! strlen($checkprivs))) { // add/delete user fieldset echo '
' . "\n" . ' ' . "\n" - . ($GLOBALS['cfg']['PropertiesIconic'] ? ' ' . "\n" : '') + . PMA_getIcon('b_usradd.png') . ' ' . $GLOBALS['strAddUser'] . '' . "\n" . '
' . "\n" . '
' . ' ' . "\n" - . ($GLOBALS['cfg']['PropertiesIconic'] ? ' ' . "\n" : '') + . PMA_getIcon('b_usrdrop.png') . ' ' . $GLOBALS['strRemoveSelectedUsers'] . '' . "\n" . ' ' . "\n" . ' ' . "\n" @@ -1472,14 +1517,15 @@ if (empty($adduser) && (! isset($checkprivs) || ! strlen($checkprivs))) { unset ($row); echo '
' . "\n" . ' ' . "\n" - . ($GLOBALS['cfg']['PropertiesIconic'] ? ' ' . "\n" : '') + . PMA_getIcon('b_usradd.png') . ' ' . $GLOBALS['strAddUser'] . '' . "\n" . '
' . "\n"; } // end if (display overview) - echo '' . "\n" - . '
' . "\n" - . ' ' . sprintf($GLOBALS['strFlushPrivilegesNote'], '', '') . "\n" - . '
' . "\n"; + echo '' . "\n"; + $flushnote = new PMA_Message('strFlushPrivilegesNote', PMA_Message::WARNING); + $flushnote->addParam(''); + $flushnote->addParam(''); + $flushnote->display(); } @@ -1488,18 +1534,28 @@ if (empty($adduser) && (! isset($checkprivs) || ! strlen($checkprivs))) { // A user was selected -> display the user's properties echo '

' . "\n" - . ($GLOBALS['cfg']['PropertiesIconic'] ? '' : '') - . $GLOBALS['strUser'] . ' \'' . htmlspecialchars($username) . '\'@\'' . htmlspecialchars($hostname) . '\'' . "\n"; + . PMA_getIcon('b_usredit.png') + . $GLOBALS['strUser'] . ' \'' + . htmlspecialchars($username) . '\'@\'' . htmlspecialchars($hostname) + . '\'' . "\n"; if (isset($dbname) && strlen($dbname)) { if ($dbname_is_wildcard) { - echo ' - ' . $GLOBALS['strDatabases']; + echo ' - ' . $GLOBALS['strDatabases']; } else { - echo ' - ' . $GLOBALS['strDatabase']; + echo ' - ' . $GLOBALS['strDatabase']; } $url_dbname = urlencode(str_replace('\_', '_', $dbname)); - echo ' ' . htmlspecialchars($dbname) . '' . "\n"; + echo ' ' + . htmlspecialchars($dbname) . '' . "\n"; if (isset($tablename) && strlen($tablename)) { - echo ' - ' . $GLOBALS['strTable'] . ' ' . htmlspecialchars($tablename) . '' . "\n"; + echo ' - ' . $GLOBALS['strTable'] . ' ' . htmlspecialchars($tablename) . '' + . "\n"; } unset($url_dbname); } @@ -1514,7 +1570,7 @@ if (empty($adduser) && (! isset($checkprivs) || ! strlen($checkprivs))) { //require_once './libraries/footer.inc.php'; } echo '
' . "\n" - . PMA_generate_common_hidden_inputs('', '', 3) + . PMA_generate_common_hidden_inputs('', '') . '' . "\n" . '' . "\n"; if (isset($dbname) && strlen($dbname)) { @@ -1524,8 +1580,7 @@ if (empty($adduser) && (! isset($checkprivs) || ! strlen($checkprivs))) { } } PMA_displayPrivTable(((! isset($dbname) || ! strlen($dbname)) ? '*' : $dbname), - (((! isset($dbname) || ! strlen($dbname)) || (! isset($tablename) || ! strlen($tablename))) ? '*' : $tablename), - TRUE, 3); + (((! isset($dbname) || ! strlen($dbname)) || (! isset($tablename) || ! strlen($tablename))) ? '*' : $tablename)); echo '
' . "\n"; if ((! isset($tablename) || ! strlen($tablename)) && empty($dbname_is_wildcard)) { @@ -1535,7 +1590,7 @@ if (empty($adduser) && (! isset($checkprivs) || ! strlen($checkprivs))) { // table header echo '
' . "\n" - . PMA_generate_common_hidden_inputs('', '', 6) + . PMA_generate_common_hidden_inputs('', '') . '' . "\n" . '' . "\n" . '
' . "\n" @@ -1801,12 +1856,12 @@ if (empty($adduser) && (! isset($checkprivs) || ! strlen($checkprivs))) { require_once './libraries/display_change_password.lib.php'; echo '' . "\n" - . PMA_generate_common_hidden_inputs('', '', 3) + . PMA_generate_common_hidden_inputs('', '') . '' . "\n" . '' . "\n" . '
' . "\n" . ' ' . $GLOBALS['strChangeCopyUser'] . '' . "\n"; - PMA_displayLoginInformationFields('change', 3); + PMA_displayLoginInformationFields('change'); echo '
' . "\n" . ' ' . $GLOBALS['strChangeCopyMode'] . '' . "\n" . '