diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-05-15 14:02:13 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-05-15 14:02:13 +0200 |
commit | 5b160edebba2a10de83b09a8010a811321dd6370 (patch) | |
tree | c67d05101ce159f6cc4f8a5fb17e0014f745cc48 /apps/files_encryption/js/settings-admin.js | |
parent | 335f2ca32190e866ab1d222b693a273cb6778ac1 (diff) | |
download | nextcloud-server-5b160edebba2a10de83b09a8010a811321dd6370.tar.gz nextcloud-server-5b160edebba2a10de83b09a8010a811321dd6370.zip |
check if the user knows the correct recovery password before changing the recovery key settings
Diffstat (limited to 'apps/files_encryption/js/settings-admin.js')
-rw-r--r-- | apps/files_encryption/js/settings-admin.js | 6 |
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"); + } } ); } |