diff options
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/personal.js | 11 | ||||
-rw-r--r-- | settings/js/users.js | 2 |
2 files changed, 8 insertions, 5 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(); } }); diff --git a/settings/js/users.js b/settings/js/users.js index 01a845367e2..48c4529527b 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -361,7 +361,7 @@ $(document).ready(function () { if ($(this).val().length > 0) { var recoveryPasswordVal = $('input:password[id="recoveryPassword"]').val(); $.post( - OC.filePath('settings', 'ajax', 'changepassword.php'), + OC.Router.generate('settings_users_changepassword'), {username: uid, password: $(this).val(), recoveryPassword: recoveryPasswordVal}, function (result) { if (result.status != 'success') { |