summaryrefslogtreecommitdiffstats
path: root/core/js/lostpassword.js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-10-20 19:05:48 +0200
committerLukas Reschke <lukas@owncloud.com>2014-11-17 17:50:19 +0100
commit1b50d4f7ceb92fffe0d38f823f175cf7e419c69e (patch)
treeb11703a94164b5457675de66df285555b3582c34 /core/js/lostpassword.js
parentaf7688ec17c260d3e227393e8e81438fe88b956c (diff)
downloadnextcloud-server-1b50d4f7ceb92fffe0d38f823f175cf7e419c69e.tar.gz
nextcloud-server-1b50d4f7ceb92fffe0d38f823f175cf7e419c69e.zip
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
Diffstat (limited to 'core/js/lostpassword.js')
-rw-r--r--core/js/lostpassword.js19
1 files changed, 6 insertions, 13 deletions
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 = {
+ ('<br /><input type="checkbox" id="encrypted-continue" value="Yes" />')
+ '<label for="encrypted-continue">'
+ t('core', 'I know what I\'m doing')
- + '</label><br />'
- + '<a id="lost-password-encryption" href>'
- + t('core', 'Reset password')
- + '</a>',
+ + '</label><br />',
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){
- $('<p id="lost-password"></p>').insertAfter($('#submit'));
+ $('<p id="lost-password"></p>').insertBefore($('#reset-password fieldset'));
} else {
$('#lost-password').replaceWith($('<p id="lost-password"></p>'));
}