summaryrefslogtreecommitdiffstats
path: root/settings/ajax/deletekeys.php
blob: 7d6c9a27aa07fdf2a2c290ad09c03a2b7c6167f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php

OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();

$l = \OC::$server->getL10N('settings');

$util = new \OCA\Files_Encryption\Util(new \OC\Files\View(), \OC_User::getUser());
$result = $util->deleteBackup('decryptAll');

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'))));
}