summaryrefslogtreecommitdiffstats
path: root/settings/ajax
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-07-30 09:48:30 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-07-30 09:48:30 +0200
commita7a7ef2b3a79607677679ea96212a20a633065e3 (patch)
tree20c40d23395fcd256e8eaa4b7df63d7b406f6c3f /settings/ajax
parentb6fa0e4eefb332dc1fb9b45df50de4621ed8e6bd (diff)
downloadnextcloud-server-a7a7ef2b3a79607677679ea96212a20a633065e3.tar.gz
nextcloud-server-a7a7ef2b3a79607677679ea96212a20a633065e3.zip
improved error handling
Diffstat (limited to 'settings/ajax')
-rw-r--r--settings/ajax/decryptall.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/settings/ajax/decryptall.php b/settings/ajax/decryptall.php
index 7adacb9802a..e53067931e8 100644
--- a/settings/ajax/decryptall.php
+++ b/settings/ajax/decryptall.php
@@ -1,5 +1,5 @@
<?php
-sleep(10);
+
//encryption app needs to be loaded
OC_App::loadApp('files_encryption');
@@ -13,9 +13,13 @@ $util = new \OCA\Encryption\Util($view, \OCP\User::getUser());
$result = $util->initEncryption($params);
if ($result !== false) {
- $util->decryptAll();
- \OCP\JSON::success(array('data' => array('message' => 'Files decrypted successfully')));
+ $successful = $util->decryptAll();
+ if ($successful === true) {
+ \OCP\JSON::success(array('data' => array('message' => 'Files decrypted successfully')));
+ } else {
+ \OCP\JSON::error(array('data' => array('message' => 'Couldn\'t decrypt your files, please check your owncloud.log or ask your administrator')));
+ }
} else {
- \OCP\JSON::error(array('data' => array('message' => 'Couldn\'t decrypt files, check your password and try again')));
+ \OCP\JSON::error(array('data' => array('message' => 'Couldn\'t decrypt your files, check your password and try again')));
}