]> source.dussan.org Git - nextcloud-server.git/commitdiff
make sure we always have the encryption key unlocked
authorRobin Appelman <icewind@owncloud.com>
Wed, 22 Feb 2012 14:18:22 +0000 (15:18 +0100)
committerRobin Appelman <icewind@owncloud.com>
Wed, 22 Feb 2012 14:18:22 +0000 (15:18 +0100)
apps/files_encryption/appinfo/app.php

index 82d2544dd1455d4525a8b9243a885ec7749cac6c..23f3955aa406a931deec7dc81fe1cd3db6757dad 100644 (file)
@@ -9,3 +9,9 @@ OC_FileProxy::register(new OC_FileProxy_Encryption());
 OC_Hook::connect('OC_User','post_login','OC_Crypt','loginListener');
 
 stream_wrapper_register('crypt','OC_CryptStream');
+
+if(!isset($_SESSION['enckey']) and OC_User::isLoggedIn()){//force the user to re-loggin if the encryption key isn't unlocked (happens when a user is logged in before the encryption app is enabled)
+       OC_User::logout();
+       header("Location: ".OC::$WEBROOT.'/');
+       exit();
+}