summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/js/settings-admin.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption/js/settings-admin.js')
-rw-r--r--apps/files_encryption/js/settings-admin.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files_encryption/js/settings-admin.js b/apps/files_encryption/js/settings-admin.js
index 2fffcf77b32..fa353901c3f 100644
--- a/apps/files_encryption/js/settings-admin.js
+++ b/apps/files_encryption/js/settings-admin.js
@@ -25,12 +25,16 @@ $(document).ready(function(){
function() {
var recoveryStatus = $( this ).val();
+ var oldStatus = (1+parseInt(recoveryStatus)) % 2;
var recoveryPassword = $( '#recoveryPassword' ).val();
$.post(
OC.filePath( 'files_encryption', 'ajax', 'adminrecovery.php' )
, { adminEnableRecovery: recoveryStatus, recoveryPassword: recoveryPassword }
, function( data ) {
- alert( data );
+ if (data.status == "error") {
+ alert("Couldn't switch recovery key mode, please check your recovery key password!");
+ $('input:radio[name="adminEnableRecovery"][value="'+oldStatus.toString()+'"]').attr("checked", "true");
+ }
}
);
}