From 1b50d4f7ceb92fffe0d38f823f175cf7e419c69e Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Mon, 20 Oct 2014 19:05:48 +0200 Subject: Warn for password reset when files_encryption is enabled This patch wil warn the user of the consequences when resetting the password and requires checking a checkbox (as we had in the past) to reset a password. Furthermore I updated the code to use our new classes and added some unit tests for it :dancers: Fixes https://github.com/owncloud/core/issues/11438 --- core/js/lostpassword.js | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'core/js') diff --git a/core/js/lostpassword.js b/core/js/lostpassword.js index ad221cb30fc..aa1a864ffed 100644 --- a/core/js/lostpassword.js +++ b/core/js/lostpassword.js @@ -8,19 +8,12 @@ OC.Lostpassword = { + ('
') + '
' - + '' - + t('core', 'Reset password') - + '', + + '
', resetErrorMsg : t('core', 'Password can not be changed. Please contact your administrator.'), init : function() { - if ($('#lost-password-encryption').length){ - $('#lost-password-encryption').click(OC.Lostpassword.sendLink); - } else { - $('#lost-password').click(OC.Lostpassword.sendLink); - } + $('#lost-password').click(OC.Lostpassword.sendLink); $('#reset-password #submit').click(OC.Lostpassword.resetPassword); }, @@ -32,8 +25,7 @@ OC.Lostpassword = { $.post( OC.generateUrl('/lostpassword/email'), { - user : $('#user').val(), - proceed: $('#encrypted-continue').attr('checked') ? 'Yes' : 'No' + user : $('#user').val() }, OC.Lostpassword.sendLinkDone ); @@ -84,7 +76,8 @@ OC.Lostpassword = { $.post( $('#password').parents('form').attr('action'), { - password : $('#password').val() + password : $('#password').val(), + proceed: $('#encrypted-continue').attr('checked') ? 'true' : 'false' }, OC.Lostpassword.resetDone ); @@ -126,7 +119,7 @@ OC.Lostpassword = { getResetStatusNode : function (){ if (!$('#lost-password').length){ - $('

').insertAfter($('#submit')); + $('

').insertBefore($('#reset-password fieldset')); } else { $('#lost-password').replaceWith($('

')); } -- cgit v1.2.3