diff options
Diffstat (limited to 'settings/js/personal.js')
-rw-r--r-- | settings/js/personal.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js index fab32b83b64..eaaca32f5d8 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -124,14 +124,17 @@ $(document).ready(function(){ $('#passwordchanged').hide(); $('#passworderror').hide(); // Ajax foo - $.post( 'ajax/changepassword.php', post, function(data){ + $.post(OC.Router.generate('settings_personal_changepassword'), post, function(data){ if( data.status === "success" ){ $('#pass1').val(''); $('#pass2').val(''); $('#passwordchanged').show(); - } - else{ - $('#passworderror').html( data.data.message ); + } else{ + if (typeof(data.data) !== "undefined") { + $('#passworderror').html(data.data.message); + } else { + $('#passworderror').html(t('Unable to change password')); + } $('#passworderror').show(); } }); |