summaryrefslogtreecommitdiffstats
path: root/apps/encryption/settings
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-03-31 17:13:36 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:29 +0200
commit1358d07d3516ffb6ecedc451bd1a0ad60d3cb673 (patch)
tree9e25e4c5c98a31c4edf0a9a4139cd93a90ac6e2d /apps/encryption/settings
parente4895bda01f9c94fc33e094ae9466e1cf5502916 (diff)
downloadnextcloud-server-1358d07d3516ffb6ecedc451bd1a0ad60d3cb673.tar.gz
nextcloud-server-1358d07d3516ffb6ecedc451bd1a0ad60d3cb673.zip
let user enable recovery key
Diffstat (limited to 'apps/encryption/settings')
-rw-r--r--apps/encryption/settings/settings-personal.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/encryption/settings/settings-personal.php b/apps/encryption/settings/settings-personal.php
index 8caacbd19ca..417bf1433bf 100644
--- a/apps/encryption/settings/settings-personal.php
+++ b/apps/encryption/settings/settings-personal.php
@@ -16,38 +16,38 @@ $crypt = new \OCA\Encryption\Crypto\Crypt(
\OC::$server->getLogger(),
\OC::$server->getUserSession(),
\OC::$server->getConfig());
+
+$util = new \OCA\Encryption\Util(
+ new \OC\Files\View(),
+ $crypt,
+ \OC::$server->getLogger(),
+ \OC::$server->getUserSession(),
+ \OC::$server->getConfig());
+
$keymanager = new \OCA\Encryption\KeyManager(
\OC::$server->getEncryptionKeyStorage(\OCA\Encryption\Crypto\Encryption::ID),
$crypt,
\OC::$server->getConfig(),
\OC::$server->getUserSession(),
$session,
- \OC::$server->getLogger(), null);
+ \OC::$server->getLogger(), $util);
$user = \OCP\User::getUser();
$view = new \OC\Files\View('/');
-$util = new \OCA\Encryption\Util(
- new \OC\Files\View(),
- $crypt, $keymanager,
- \OC::$server->getLogger(),
- \OC::$server->getUserSession(),
- \OC::$server->getConfig());
+
$privateKeySet = $session->isPrivateKeySet();
// did we tried to initialize the keys for this session?
$initialized = $session->getStatus();
$recoveryAdminEnabled = \OC::$server->getConfig()->getAppValue('encryption', 'recoveryAdminEnabled');
-$recoveryEnabledForUser = $util->recoveryEnabledForUser();
+$recoveryEnabledForUser = $util->isRecoveryEnabledForUser();
$result = false;
if ($recoveryAdminEnabled || !$privateKeySet) {
-
- \OCP\Util::addscript('encryption', 'settings-personal');
-
$tmpl->assign('recoveryEnabled', $recoveryAdminEnabled);
$tmpl->assign('recoveryEnabledForUser', $recoveryEnabledForUser);
$tmpl->assign('privateKeySet', $privateKeySet);