summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/appinfo/app.php
diff options
context:
space:
mode:
authorSam Tuke <samtuke@owncloud.com>2012-12-11 15:10:56 +0000
committerSam Tuke <samtuke@owncloud.com>2012-12-11 15:10:56 +0000
commita00dd2d5d6ba908e230af4b555ed0bc902cafd15 (patch)
tree8ce450fe571976393acd5ee2d6ccd2ad145614b8 /apps/files_encryption/appinfo/app.php
parentb66d38ecae3a2e7914520a90c5ef01cbc1432c10 (diff)
downloadnextcloud-server-a00dd2d5d6ba908e230af4b555ed0bc902cafd15.tar.gz
nextcloud-server-a00dd2d5d6ba908e230af4b555ed0bc902cafd15.zip
Revert "Revert "Development snapshot""
This reverts commit b66d38ecae3a2e7914520a90c5ef01cbc1432c10.
Diffstat (limited to 'apps/files_encryption/appinfo/app.php')
-rw-r--r--apps/files_encryption/appinfo/app.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php
index 45f43d70ff0..6c082b1938c 100644
--- a/apps/files_encryption/appinfo/app.php
+++ b/apps/files_encryption/appinfo/app.php
@@ -6,6 +6,7 @@ OC::$CLASSPATH['OCA\Encryption\Util'] = 'apps/files_encryption/lib/util.php';
OC::$CLASSPATH['OCA\Encryption\Keymanager'] = 'apps/files_encryption/lib/keymanager.php';
OC::$CLASSPATH['OCA\Encryption\Stream'] = 'apps/files_encryption/lib/stream.php';
OC::$CLASSPATH['OCA\Encryption\Proxy'] = 'apps/files_encryption/lib/proxy.php';
+OC::$CLASSPATH['OCA\Encryption\Session'] = 'apps/files_encryption/lib/session.php';
OC_FileProxy::register(new OCA\Encryption\Proxy());
@@ -15,7 +16,13 @@ OCP\Util::connectHook('OC_User','post_setPassword','OCA\Encryption\Hooks','setPa
stream_wrapper_register( 'crypt', 'OCA\Encryption\Stream');
-if( !isset( $_SESSION['enckey'] ) && OCP\User::isLoggedIn() && OCA\Encryption\Crypt::mode() == 'server' ) {
+$session = new OCA\Encryption\Session();
+
+if (
+! $session->getPrivateKey( \OCP\USER::getUser() )
+&& OCP\User::isLoggedIn()
+&& OCA\Encryption\Crypt::mode() == 'server'
+) {
// Force the user to re-log in if the encryption key isn't unlocked (happens when a user is logged in before the encryption app is enabled)
OCP\User::logout();