diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 37a578bcd6..8d5e2dc23f 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -1559,8 +1559,6 @@ function PMA_getWithClauseForAddUserAndUpdatePrivs() */ function PMA_getHtmlForAddUser($dbname) { - $GLOBALS['url_query'] .= '&adduser=1'; - $html_output = '

' . "\n" . PMA_Util::getIcon('b_usradd.png') . __('Add user') . "\n" . '

' . "\n" @@ -1729,7 +1727,7 @@ function PMA_getHtmlForSpecificDbPrivileges() . '' . '' . "\n"; - if ($GLOBALS['is_ajax_request'] == true + if ($GLOBALS['is_ajax_request'] == true && empty($_REQUEST['ajax_page_request']) ) { $message = PMA_Message::success(__('User has been added.')); @@ -1742,12 +1740,15 @@ function PMA_getHtmlForSpecificDbPrivileges() $html_output .= '
' . "\n" . '' . _pgettext('Create new user', 'New') . '' . "\n"; - $html_output .= ' 1, + 'dbname' => $_REQUEST['checkprivs'], + ) + ) .'" rel="' - .'checkprivs='.htmlspecialchars($_REQUEST['checkprivs']) - . '&'.$GLOBALS['url_query'] + . PMA_URL_getCommon(array('checkprivs' => $_REQUEST['checkprivs'])) . '" class="ajax" name="db_specific">' . "\n" . PMA_Util::getIcon('b_usradd.png') . ' ' . __('Add user') . '' . "\n"; @@ -1841,7 +1842,7 @@ function PMA_getHtmlTableBodyForSpecificDbPrivs($found, $row, $odd_row, . '' . "\n"; $html_output .= PMA_getUserEditLink( $current_user, $current_host, - (isset($current['Db']) && $current['Db'] != '*') + (isset($current['Db']) && $current['Db'] != '*') ? $current['Db'] : '' ); $html_output .= '' . "\n" @@ -2024,7 +2025,7 @@ function PMA_getExtraDataForAjaxBehavior( . '' . "\n"; $new_user_string .= '' . PMA_getUserExportLink( - $username, + $username, $hostname, isset($_GET['initial']) ? $_GET['initial'] : '' ) @@ -2039,8 +2040,8 @@ function PMA_getExtraDataForAjaxBehavior( * pagination */ $new_user_initial = strtoupper(substr($username, 0, 1)); - $new_user_initial_string = '' + $new_user_initial_string = '' . $new_user_initial . ''; $extra_data['new_user_initial'] = $new_user_initial; $extra_data['new_user_initial_string'] = $new_user_initial_string; @@ -2134,8 +2135,14 @@ function PMA_getChangeLoginInformationHtmlForm($username, $hostname) function PMA_getLinkToDbAndTable($url_dbname, $dbname, $tablename) { $html_output = '[ ' . __('Database') - . ' ' + . ' ' . htmlspecialchars($dbname) . ': ' . PMA_Util::getTitleForTarget( $GLOBALS['cfg']['DefaultTabDatabase'] @@ -2144,10 +2151,15 @@ function PMA_getLinkToDbAndTable($url_dbname, $dbname, $tablename) if (strlen($tablename)) { $html_output .= ' [ ' . __('Table') . ' ' . htmlspecialchars($tablename) . ': ' + . $GLOBALS['cfg']['DefaultTabTable'] + . PMA_URL_getCommon( + array( + 'db' => $url_dbname, + 'table' => $tablename, + 'reload' => 1, + ) + ) + . '">' . htmlspecialchars($tablename) . ': ' . PMA_Util::getTitleForTarget( $GLOBALS['cfg']['DefaultTabTable'] ) @@ -2162,7 +2174,7 @@ function PMA_getLinkToDbAndTable($url_dbname, $dbname, $tablename) * So this function returns user rights as an array * * @param array $tables tables - * @param string $user_host_condition a where clause that containd user's host + * @param string $user_host_condition a where clause that containd user's host * condition * @param string $dbname database name * @@ -2346,7 +2358,7 @@ function PMA_getHtmlForDisplayUserRightsInRows($db_rights, $dbname, * * @return array $html_output, $found_rows */ -function PMA_getTableForDisplayAllTableSpecificRights( +function PMA_getTableForDisplayAllTableSpecificRights( $username, $hostname, $dbname ) { // table header @@ -2436,7 +2448,7 @@ function PMA_getHtmlForDisplaySelectDbInEditPrivs($found_rows) // already escaped in $found_rows, // contrary to the output of SHOW DATABASES if (empty($found_rows) || ! in_array($current_db, $found_rows)) { - $html_output .= '' . "\n"; } @@ -2603,13 +2615,6 @@ function PMA_getTableBodyForUserRightsTable($db_rights) $userGroupCount = $GLOBALS['dbi']->fetchValue( $sqlQuery, 0, 0, $GLOBALS['controllink'] ); - - $link_edit_user_group = '' - . PMA_Util::getIcon('b_usrlist.png', __('Edit user group')) - . ''; } $odd_row = true; @@ -2678,10 +2683,12 @@ function PMA_getTableBodyForUserRightsTable($db_rights) $html_output .= ''; } else { $html_output .= '' - . sprintf( - $link_edit_user_group, - urlencode($host['User']) - ) + . '' + . PMA_Util::getIcon('b_usrlist.png', __('Edit user group')) + . '' . ''; } } @@ -2707,9 +2714,9 @@ function PMA_getTableBodyForUserRightsTable($db_rights) function PMA_getFieldsetForAddDeleteUser() { $html_output = '
' . "\n"; - $html_output .= '' . "\n" + $html_output .= '' . "\n" . PMA_Util::getIcon('b_usradd.png') . ' ' . __('Add user') . '' . "\n"; $html_output .= '
' . "\n"; @@ -2721,28 +2728,28 @@ function PMA_getFieldsetForAddDeleteUser() . '' . "\n"; $html_output .= '' . "\n" - . '(' - . __('Revoke all active privileges from the users and delete them afterwards.') + . '(' + . __('Revoke all active privileges from the users and delete them afterwards.') . ')' . '
' . "\n"; $html_output .= '' . "\n"; $html_output .= '' . "\n" . '
' . "\n"; - $html_output .= '