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
From f530865b3d952e10c5c295f6dbe1138a667fa659 Mon Sep 17 00:00:00 2001
From: Lukas Reschke
Date: Wed, 29 Oct 2014 13:26:24 +0100
Subject: Hide submit button after password change
Creating a new key pair can take 1-2 seconds. So it could happen that the user click the "Reset password" button again which can lead to many nasty things, e.g. we could create two new key pairs in parallel.
---
core/js/lostpassword.js | 3 +++
1 file changed, 3 insertions(+)
(limited to 'core/js')
diff --git a/core/js/lostpassword.js b/core/js/lostpassword.js
index aa1a864ffed..7145e219654 100644
--- a/core/js/lostpassword.js
+++ b/core/js/lostpassword.js
@@ -82,6 +82,9 @@ OC.Lostpassword = {
OC.Lostpassword.resetDone
);
}
+ if($('#encrypted-continue').attr('checked')) {
+ $('#reset-password #submit').hide();
+ }
},
resetDone : function(result){
--
cgit v1.2.3
From 9eeea57e3abc4a1cfb1d303eae5f454f3d382b3f Mon Sep 17 00:00:00 2001
From: Lukas Reschke
Date: Mon, 17 Nov 2014 17:49:58 +0100
Subject: Show spinner
---
core/js/lostpassword.js | 1 +
core/lostpassword/templates/resetpassword.php | 1 +
2 files changed, 2 insertions(+)
(limited to 'core/js')
diff --git a/core/js/lostpassword.js b/core/js/lostpassword.js
index 7145e219654..35173fd3d33 100644
--- a/core/js/lostpassword.js
+++ b/core/js/lostpassword.js
@@ -84,6 +84,7 @@ OC.Lostpassword = {
}
if($('#encrypted-continue').attr('checked')) {
$('#reset-password #submit').hide();
+ $('#reset-password #float-spinner').removeClass('hidden');
}
},
diff --git a/core/lostpassword/templates/resetpassword.php b/core/lostpassword/templates/resetpassword.php
index ebd7bff2668..bac8b5c75c9 100644
--- a/core/lostpassword/templates/resetpassword.php
+++ b/core/lostpassword/templates/resetpassword.php
@@ -13,5 +13,6 @@ script('core', 'lostpassword');
+
--
cgit v1.2.3