diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2016-06-27 11:30:13 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2016-06-27 14:08:11 +0200 |
commit | 2a990a0db5199ac842b50b580300bbeb2d2e794c (patch) | |
tree | ad76ae23635def5b724005ae6b13b25d6b3d4def /settings/js/personal.js | |
parent | d4989c80379d4cac71ae76ec8df79090f2e4c25f (diff) | |
download | nextcloud-server-2a990a0db5199ac842b50b580300bbeb2d2e794c.tar.gz nextcloud-server-2a990a0db5199ac842b50b580300bbeb2d2e794c.zip |
verify user password on change
Diffstat (limited to 'settings/js/personal.js')
-rw-r--r-- | settings/js/personal.js | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js index c9e575afd6b..16a8d184da6 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -192,6 +192,7 @@ $(document).ready(function () { $('#pass2').showPassword().keyup(); } $("#passwordbutton").click(function () { + OC.msg.startSaving('#password-error-msg'); var isIE8or9 = $('html').hasClass('lte9'); // FIXME - TODO - once support for IE8 and IE9 is dropped // for IE8 and IE9 this will check additionally if the typed in password @@ -208,25 +209,32 @@ $(document).ready(function () { if (data.status === "success") { $('#pass1').val(''); $('#pass2').val('').change(); - // Hide a possible errormsg and show successmsg - $('#password-changed').removeClass('hidden').addClass('inlineblock'); - $('#password-error').removeClass('inlineblock').addClass('hidden'); + OC.msg.finishedSaving('#password-error-msg', data); } else { if (typeof(data.data) !== "undefined") { - $('#password-error').text(data.data.message); + OC.msg.finishedSaving('#password-error-msg', data); } else { - $('#password-error').text(t('Unable to change password')); + OC.msg.finishedSaving('#password-error-msg', + { + 'status' : 'error', + 'data' : { + 'message' : t('core', 'Unable to change password') + } + } + ); } - // Hide a possible successmsg and show errormsg - $('#password-changed').removeClass('inlineblock').addClass('hidden'); - $('#password-error').removeClass('hidden').addClass('inlineblock'); } }); return false; } else { - // Hide a possible successmsg and show errormsg - $('#password-changed').removeClass('inlineblock').addClass('hidden'); - $('#password-error').removeClass('hidden').addClass('inlineblock'); + OC.msg.finishedSaving('#password-error-msg', + { + 'status' : 'error', + 'data' : { + 'message' : t('core', 'Unable to change password') + } + } + ); return false; } |