summaryrefslogtreecommitdiffstats
path: root/settings/ajax
diff options
context:
space:
mode:
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')));
}