diff --git a/ChangeLog b/ChangeLog index a8a1f15813..44db2cedb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -99,6 +99,7 @@ underscore + Remove the database ordering sub-feature of the only_db directive - bug #3840 When exporting to gzip format, the data is compressed 2 times + rfe #1319 Permit to create index when creating foreign key +- bug #3703 Incorrect updating of the list of users 3.5.8.0 (not yet released) - bug #3828 MariaDB reported as MySQL diff --git a/js/server_privileges.js b/js/server_privileges.js index 19c907b30f..f6c05999f1 100644 --- a/js/server_privileges.js +++ b/js/server_privileges.js @@ -375,6 +375,23 @@ AJAX.registerOnload('server_privileges.js', function() { */ var curr_submit_value = $t.find('.tblFooters').find('input:submit').val(); + // If any option other than 'keep the old one'(option 4) is chosen, we need to remove + // the old one from the table. + var $row_to_remove; + if (curr_submit_name == 'change_copy' + && $('input[name=mode]:checked', '#fieldset_mode').val() != '4') { + var old_username = $t.find('input[name="old_username"]').val(); + var old_hostname = $t.find('input[name="old_hostname"]').val(); + $('#usersForm tbody tr').each(function() { + var $tr = $(this); + if ($tr.find('td:nth-child(2) label').text() == old_username + && $tr.find('td:nth-child(3)').text() == old_hostname) { + $row_to_remove = $tr; + return false; + } + }); + } + $.post($t.attr('action'), $t.serialize() + '&' + curr_submit_name + '=' + curr_submit_value, function(data) { if (data.success == true) { $('#page_content').show(); @@ -394,6 +411,11 @@ AJAX.registerOnload('server_privileges.js', function() { } } //Show SQL Query that was executed + // Remove the old row if the old user is deleted + if ($row_to_remove != null) { + $row_to_remove.remove(); + } + //Append new user if necessary if (data.new_user_string) { appendNewUser(data.new_user_string, data.new_user_initial, data.new_user_initial_string); diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 4f2d0711ae..d0cc5bb421 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -1937,7 +1937,7 @@ function PMA_getChangeLoginInformationHtmlForm($username, $hostname) . '' . "\n" . PMA_getHtmlForDisplayLoginInformationFields('change'); - $html_output .= '