From b6fa0e4eefb332dc1fb9b45df50de4621ed8e6bd Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 29 Jul 2013 17:06:05 +0200 Subject: working decrypt files method --- settings/ajax/decryptall.php | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'settings/ajax/decryptall.php') diff --git a/settings/ajax/decryptall.php b/settings/ajax/decryptall.php index 02a9bfe96b1..7adacb9802a 100644 --- a/settings/ajax/decryptall.php +++ b/settings/ajax/decryptall.php @@ -1,14 +1,21 @@ \OCP\User::getUser(), + 'password' => $_POST['password']); -OCA\Encryption\Crypt::decryptAll(); - -if ($status === false) { - OC_App::disable('files_encryption'); -} +$view = new OC_FilesystemView('/'); +$util = new \OCA\Encryption\Util($view, \OCP\User::getUser()); +$result = $util->initEncryption($params); -\OCP\JSON::success(array('data' => array('message' => 'looks good'))); +if ($result !== false) { + $util->decryptAll(); + \OCP\JSON::success(array('data' => array('message' => 'Files decrypted successfully'))); +} else { + \OCP\JSON::error(array('data' => array('message' => 'Couldn\'t decrypt files, check your password and try again'))); +} -- cgit v1.2.3