The branch, master has been updated via ef48add94c60abdc056303aed9f7eab3cb347f93 (commit) from ae4ec340d62c37b3fa50b1a43e442c79e50bcc5a (commit)
- Log ----------------------------------------------------------------- commit ef48add94c60abdc056303aed9f7eab3cb347f93 Author: Rouslan Placella rouslan@placella.com Date: Tue Apr 5 16:21:09 2011 -0400
Patch 3276551 for another issue in bug 3188444
-----------------------------------------------------------------------
Summary of changes: js/server_privileges.js | 14 ++++++++++++-- server_privileges.php | 6 +++++- 2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/js/server_privileges.js b/js/server_privileges.js index 0d8fe40..8b9c5e9 100644 --- a/js/server_privileges.js +++ b/js/server_privileges.js @@ -389,8 +389,18 @@ $(document).ready(function() { appendNewUser(data.new_user_string, data.new_user_initial, data.new_user_initial_string); }
- //Change privileges if they were edited - if(data.new_privileges) { + //Check if we are on the page of the db-specific 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") .find('.current_row') .find('tt') diff --git a/server_privileges.php b/server_privileges.php index 1389cb9..51127ce 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -1440,6 +1440,10 @@ if( $GLOBALS['is_ajax_request'] && !isset($_REQUEST['export']) && !isset($_REQUE }
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));
$extra_data['new_privileges'] = $new_privileges; @@ -2161,7 +2165,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs . '</form>' . "\n"; } else { // 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" . PMA_getIcon('b_usrcheck.png') . ' ' . sprintf(__('Users having access to "%s"'), '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . PMA_generate_common_url($checkprivs) . '">' . htmlspecialchars($checkprivs) . '</a>') . "\n"
hooks/post-receive