summaryrefslogtreecommitdiffstats
path: root/apps/encryption/settings
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-03-27 18:10:32 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:28 +0200
commit24c6604388c0c3a32517e1aa18ebd851e1f7a6a1 (patch)
tree9e68ac5af49b2e16887345248f24b494020d4fb2 /apps/encryption/settings
parentbd99042a66acef066bebac1694dd2c431166fe2b (diff)
downloadnextcloud-server-24c6604388c0c3a32517e1aa18ebd851e1f7a6a1.tar.gz
nextcloud-server-24c6604388c0c3a32517e1aa18ebd851e1f7a6a1.zip
add public link share key to file if it was shared as public link
Diffstat (limited to 'apps/encryption/settings')
-rw-r--r--apps/encryption/settings/settings-personal.php26
1 files changed, 24 insertions, 2 deletions
diff --git a/apps/encryption/settings/settings-personal.php b/apps/encryption/settings/settings-personal.php
index dc1ef167b11..d1da649e374 100644
--- a/apps/encryption/settings/settings-personal.php
+++ b/apps/encryption/settings/settings-personal.php
@@ -10,13 +10,35 @@
\OC_Util::addStyle('encryption', 'settings-personal');
$tmpl = new OCP\Template('encryption', 'settings-personal');
+$crypt = new \OCA\Encryption\Crypto\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(),
+ \OC::$server->getSession(),
+ \OC::$server->getLogger());
$user = \OCP\User::getUser();
+
$view = new \OC\Files\View('/');
-$util = new \OCA\Files_Encryption\Util($view, $user);
+
+$util = new \OCA\Encryption\Util(
+ new \OC\Files\View(),
+ new \OC\Files\Filesystem(),
+ $crypt,
+ $keymanager,
+ \OC::$server->getLogger(),
+ \OC::$server->getUserSession(),
+ \OC::$server->getConfig());
+
$session = new \OCA\Files_Encryption\Session($view);
+$session = \OC::$server->getSession();
-$privateKeySet = $session->getPrivateKey() !== false;
+$privateKeySet = $session->get('privateKey') !== false;
// did we tried to initialize the keys for this session?
$initialized = $session->getInitialized();