Update the privileges field in the usersForm table when the user is changed

This commit is contained in:
ninadsp
2010-07-23 00:18:15 +05:30
parent 85d42b8a57
commit 4054332641
2 changed files with 22 additions and 0 deletions

View File

@@ -252,6 +252,8 @@ $(document).ready(function() {
PMA_ajaxShowMessage(); PMA_ajaxShowMessage();
$(this).parents('tr').addClass('current_row');
var button_options = {}; var button_options = {};
button_options[PMA_messages['strCancel']] = function() {$(this).dialog("close").remove();} button_options[PMA_messages['strCancel']] = function() {$(this).dialog("close").remove();}
@@ -327,6 +329,17 @@ $(document).ready(function() {
$("#initials_table").find('td:contains('+data.new_user_initial+')') $("#initials_table").find('td:contains('+data.new_user_initial+')')
.html(data.new_user_initial_string); .html(data.new_user_initial_string);
} }
if(data.new_privileges) {
$("#usersForm")
.find('.current_row')
.find('tt')
.html(data.new_privileges);
}
$("#usersForm")
.find('.current_row')
.removeClass('current_row');
} }
else { else {
PMA_ajaxShowMessage(data.error); PMA_ajaxShowMessage(data.error);

View File

@@ -1372,9 +1372,11 @@ $link_export = '<a class="export_user_anchor" href="server_privileges.php?' . $G
* show $message and exit. * show $message and exit.
*/ */
if( $GLOBALS['is_ajax_request'] && !isset($_REQUEST['export']) && !isset($_REQUEST['adduser']) && !isset($_REQUEST['initial']) && !isset($_REQUEST['showall']) && !isset($_REQUEST['edit_user_dialog'])) { if( $GLOBALS['is_ajax_request'] && !isset($_REQUEST['export']) && !isset($_REQUEST['adduser']) && !isset($_REQUEST['initial']) && !isset($_REQUEST['showall']) && !isset($_REQUEST['edit_user_dialog'])) {
if(isset($sql_query)) { if(isset($sql_query)) {
$extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query); $extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
} }
if(isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) { if(isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) {
//generate html on the fly for the new user that was just created. //generate html on the fly for the new user that was just created.
$new_user_string = '<tr>'."\n" $new_user_string = '<tr>'."\n"
@@ -1417,6 +1419,13 @@ if( $GLOBALS['is_ajax_request'] && !isset($_REQUEST['export']) && !isset($_REQUE
$extra_data['new_user_initial'] = $new_user_initial; $extra_data['new_user_initial'] = $new_user_initial;
$extra_data['new_user_initial_string'] = $new_user_initial_string; $extra_data['new_user_initial_string'] = $new_user_initial_string;
} }
if(isset($update_privs)) {
$new_privileges = join(', ', PMA_extractPrivInfo());
$extra_data['new_privileges'] = $new_privileges;
}
PMA_ajaxResponse($message, $message->isSuccess(), $extra_data); PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
} }