diff --git a/js/functions.js b/js/functions.js index 1bcac63d4..5dfb27e75 100755 --- a/js/functions.js +++ b/js/functions.js @@ -2072,4 +2072,51 @@ $(document).ready(function() { } }) }) +}) + +/** + * jQuery coding for 'Change Password' on main.php + */ +$(document).ready(function() { + + $('#change_password_anchor').live('click', function(event) { + event.preventDefault(); + + var button_options = {}; + + button_options[PMA_messages['strCancel']] = function() {$(this).dialog('close').remove();} + + $.get($(this).attr('href'), {'ajax_request': true}, function(data) { + $('
'); + + $.post($(the_form).attr('action'), $(the_form).serialize(), function(data) { + if(data.success == true) { + + PMA_ajaxShowMessage(data.message); + + $("#topmenucontainer").after(data.sql_query); + + $("#change_password_dialog").hide().remove(); + } + else { + PMA_ajaxShowMessage(data.error); + } + }) + }) }) \ No newline at end of file diff --git a/js/messages.php b/js/messages.php index fefc5d523..7e538e7c6 100755 --- a/js/messages.php +++ b/js/messages.php @@ -103,6 +103,7 @@ $js_messages['strChangeDisplay'] = __('Choose column to display'); /* password generation */ $js_messages['strGeneratePassword'] = __('Generate password'); $js_messages['strGenerate'] = __('Generate'); +$js_messages['strChangePassword'] = __('Change Password'); echo "var PMA_messages = new Array();\n"; foreach ($js_messages as $name => $js_message) { diff --git a/libraries/display_change_password.lib.php b/libraries/display_change_password.lib.php index 43a61f6ef..e7bdad29e 100755 --- a/libraries/display_change_password.lib.php +++ b/libraries/display_change_password.lib.php @@ -19,7 +19,7 @@ $chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5) // Displays the form ?> -