diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-05-22 18:01:18 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-05-22 18:01:18 +0200 |
commit | 15a3ae6db14fd021d3c9ca672a8afc98b86cf174 (patch) | |
tree | e87aa54c92d485d0f50bfc1578b040d6ee82d755 /apps/files_encryption/js | |
parent | ee53bd1aa3e3cb62a93dfda66141e3537426d5dd (diff) | |
download | nextcloud-server-15a3ae6db14fd021d3c9ca672a8afc98b86cf174.tar.gz nextcloud-server-15a3ae6db14fd021d3c9ca672a8afc98b86cf174.zip |
improved error messages
Diffstat (limited to 'apps/files_encryption/js')
-rw-r--r-- | apps/files_encryption/js/settings-admin.js | 10 |
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(""); |