From 2a3cb7ac5ba5a958b212de86dea62735c3f9d503 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 24 Jan 2014 11:35:52 +0100 Subject: [PATCH 1/2] remove the form, it isn't needed here --- settings/js/personal.js | 5 ++-- settings/templates/personal.php | 42 ++++++++++++++++----------------- 2 files changed, 22 insertions(+), 25 deletions(-) diff --git a/settings/js/personal.js b/settings/js/personal.js index aa55832469..57b69fd7b6 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -283,10 +283,9 @@ OC.Encryption = { } else { OC.Encryption.msg.finishedDecrypting('#decryptAll .msg', data); } - } - ); + }); } -} +}; OC.Encryption.msg={ startDecrypting:function(selector){ diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 1518b48b97..a38178e63a 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -146,29 +146,27 @@ if($_['passwordChangeSupported']) { };?> -
-
-

- t( 'Encryption' ) ); ?> -

- t( "The encryption app is no longer enabled, please decrypt all your files" )); ?> -

- - -
- - -

+
+

+ t( 'Encryption' ) ); ?> +

+ t( "The encryption app is no longer enabled, please decrypt all your files" )); ?> +

+ +
-

- + + +

+
+
From 6bb27ea76bc007908a1b48b7ee8441347f84296b Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 24 Jan 2014 12:05:14 +0100 Subject: [PATCH 2/2] disable button and input field during decryption --- settings/js/personal.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/settings/js/personal.js b/settings/js/personal.js index 57b69fd7b6..e6e1d538a1 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -206,6 +206,8 @@ $(document).ready(function(){ $('button:button[name="submitDecryptAll"]').click(function() { var privateKeyPassword = $('#decryptAll input:password[id="privateKeyPassword"]').val(); + $('#decryptAll button:button[name="submitDecryptAll"]').prop("disabled", true); + $('#decryptAll input:password[name="privateKeyPassword"]').prop("disabled", true); OC.Encryption.decryptAll(privateKeyPassword); }); @@ -214,6 +216,8 @@ $(document).ready(function(){ if (privateKeyPassword !== '' ) { $('#decryptAll button:button[name="submitDecryptAll"]').removeAttr("disabled"); if(event.which === 13) { + $('#decryptAll button:button[name="submitDecryptAll"]').prop("disabled", true); + $('#decryptAll input:password[name="privateKeyPassword"]').prop("disabled", true); OC.Encryption.decryptAll(privateKeyPassword); } } else { @@ -280,6 +284,7 @@ OC.Encryption = { $.post('ajax/decryptall.php', {password:password}, function(data) { if (data.status === "error") { OC.Encryption.msg.finishedDecrypting('#decryptAll .msg', data); + $('#decryptAll input:password[name="privateKeyPassword"]').removeAttr("disabled"); } else { OC.Encryption.msg.finishedDecrypting('#decryptAll .msg', data); }