From 15a3ae6db14fd021d3c9ca672a8afc98b86cf174 Mon Sep 17 00:00:00 2001 From: Björn Schießle Date: Wed, 22 May 2013 18:01:18 +0200 Subject: improved error messages --- apps/files_encryption/ajax/adminrecovery.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'apps/files_encryption/ajax/adminrecovery.php') 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!'))); +} -- cgit v1.2.3