summaryrefslogtreecommitdiffstats
path: root/settings/ajax/deletekeys.php
diff options
context:
space:
mode:
Diffstat (limited to 'settings/ajax/deletekeys.php')
-rw-r--r--settings/ajax/deletekeys.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/settings/ajax/deletekeys.php b/settings/ajax/deletekeys.php
index 86a45820af9..7d6c9a27aa0 100644
--- a/settings/ajax/deletekeys.php
+++ b/settings/ajax/deletekeys.php
@@ -4,13 +4,11 @@ OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
$l = \OC::$server->getL10N('settings');
-$user = \OC_User::getUser();
-$view = new \OC\Files\View('/' . $user . '/files_encryption');
-$keyfilesDeleted = $view->deleteAll('keyfiles.backup');
-$sharekeysDeleted = $view->deleteAll('share-keys.backup');
+$util = new \OCA\Files_Encryption\Util(new \OC\Files\View(), \OC_User::getUser());
+$result = $util->deleteBackup('decryptAll');
-if ($keyfilesDeleted && $sharekeysDeleted) {
+if ($result) {
\OCP\JSON::success(array('data' => array('message' => $l->t('Encryption keys deleted permanently'))));
} else {
\OCP\JSON::error(array('data' => array('message' => $l->t('Couldn\'t permanently delete your encryption keys, please check your owncloud.log or ask your administrator'))));