Patch 3276551 for another issue in bug 3188444

This commit is contained in:
Rouslan Placella
2011-04-05 16:21:09 -04:00
committed by Marc Delisle
parent ae4ec340d6
commit ef48add94c
2 changed files with 17 additions and 3 deletions

View File

@@ -389,8 +389,18 @@ $(document).ready(function() {
appendNewUser(data.new_user_string, data.new_user_initial, data.new_user_initial_string); appendNewUser(data.new_user_string, data.new_user_initial, data.new_user_initial_string);
} }
//Change privileges if they were edited //Check if we are on the page of the db-specific privileges
if(data.new_privileges) { var db_priv_page = !!($('#dbspecificuserrights').length); // the "!!" part is merely there to ensure a value of type boolean
// we always need to reload on the db-specific privilege page
// and on the global page when adjusting global privileges,
// but not on the global page when adjusting db-specific privileges.
var reload_privs = false;
if (data.db_specific_privs == false || (db_priv_page == data.db_specific_privs)) {
reload_privs = true;
}
//Change privileges, if they were edited and need to be reloaded
if(data.new_privileges && reload_privs) {
$("#usersForm") $("#usersForm")
.find('.current_row') .find('.current_row')
.find('tt') .find('tt')

View File

@@ -1440,6 +1440,10 @@ if( $GLOBALS['is_ajax_request'] && !isset($_REQUEST['export']) && !isset($_REQUE
} }
if(isset($update_privs)) { if(isset($update_privs)) {
$extra_data['db_specific_privs'] = false;
if (isset($dbname_is_wildcard)) {
$extra_data['db_specific_privs'] = !$dbname_is_wildcard;
}
$new_privileges = join(', ', PMA_extractPrivInfo('', true)); $new_privileges = join(', ', PMA_extractPrivInfo('', true));
$extra_data['new_privileges'] = $new_privileges; $extra_data['new_privileges'] = $new_privileges;
@@ -2161,7 +2165,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
. '</form>' . "\n"; . '</form>' . "\n";
} else { } else {
// check the privileges for a particular database. // check the privileges for a particular database.
echo '<form id="usersForm"><table id="tablespecificuserrights" class="data">' . "\n" echo '<form id="usersForm"><table id="dbspecificuserrights" class="data">' . "\n"
. '<caption class="tblHeaders">' . "\n" . '<caption class="tblHeaders">' . "\n"
. PMA_getIcon('b_usrcheck.png') . PMA_getIcon('b_usrcheck.png')
. ' ' . sprintf(__('Users having access to &quot;%s&quot;'), '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . PMA_generate_common_url($checkprivs) . '">' . htmlspecialchars($checkprivs) . '</a>') . "\n" . ' ' . sprintf(__('Users having access to &quot;%s&quot;'), '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . PMA_generate_common_url($checkprivs) . '">' . htmlspecialchars($checkprivs) . '</a>') . "\n"