aboutsummaryrefslogtreecommitdiffstats
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.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/files_encryption/js/settings-admin.js b/apps/files_encryption/js/settings-admin.js
index dbae42b011c..c58d75341df 100644
--- a/apps/files_encryption/js/settings-admin.js
+++ b/apps/files_encryption/js/settings-admin.js
@@ -44,19 +44,19 @@ $(document).ready(function(){
$( 'input:radio[name="adminEnableRecovery"]' ).change(
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 ) {
- if (data.status == "error") {
- alert("Couldn't switch recovery key mode, please check your recovery key password!");
+ , function( result ) {
+ if (result.status === "error") {
+ OC.Notification.show(t('admin', result.data.message));
$('input:radio[name="adminEnableRecovery"][value="'+oldStatus.toString()+'"]').attr("checked", "true");
} else {
- if (recoveryStatus == "0") {
+ OC.Notification.hide();
+ if (recoveryStatus === "0") {
$('button:button[name="submitChangeRecoveryKey"]').attr("disabled", "true");
$('input:password[name="changeRecoveryPassword"]').attr("disabled", "true");
$('input:password[name="changeRecoveryPassword"]').val("");