summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/ajax/adminrecovery.php
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-05-22 18:01:18 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-05-22 18:01:18 +0200
commit15a3ae6db14fd021d3c9ca672a8afc98b86cf174 (patch)
treee87aa54c92d485d0f50bfc1578b040d6ee82d755 /apps/files_encryption/ajax/adminrecovery.php
parentee53bd1aa3e3cb62a93dfda66141e3537426d5dd (diff)
downloadnextcloud-server-15a3ae6db14fd021d3c9ca672a8afc98b86cf174.tar.gz
nextcloud-server-15a3ae6db14fd021d3c9ca672a8afc98b86cf174.zip
improved error messages
Diffstat (limited to 'apps/files_encryption/ajax/adminrecovery.php')
-rw-r--r--apps/files_encryption/ajax/adminrecovery.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files_encryption/ajax/adminrecovery.php b/apps/files_encryption/ajax/adminrecovery.php
index a32225d0366..306f0088be3 100644
--- a/apps/files_encryption/ajax/adminrecovery.php
+++ b/apps/files_encryption/ajax/adminrecovery.php
@@ -22,6 +22,7 @@ $recoveryKeyId = OC_Appconfig::getValue('files_encryption', 'recoveryKeyId');
if (isset($_POST['adminEnableRecovery']) && $_POST['adminEnableRecovery'] == 1){
$return = \OCA\Encryption\Helper::adminEnableRecovery($recoveryKeyId, $_POST['recoveryPassword']);
+ $action = "enable";
// Disable recoveryAdmin
} elseif (
@@ -29,7 +30,12 @@ if (isset($_POST['adminEnableRecovery']) && $_POST['adminEnableRecovery'] == 1){
&& 0 == $_POST['adminEnableRecovery']
) {
$return = \OCA\Encryption\Helper::adminDisableRecovery($_POST['recoveryPassword']);
+ $action = "disable";
}
// Return success or failure
-( $return ) ? \OCP\JSON::success() : \OCP\JSON::error(); \ No newline at end of file
+if ($return) {
+ \OCP\JSON::success(array("data" => array( "message" => 'Recovery key successfully ' . $action.'d')));
+} else {
+ \OCP\JSON::error(array("data" => array( "message" => 'Could not '.$action.' recovery key. Please check your recovery key password!')));
+}