From: Robin Appelman Date: Wed, 22 Feb 2012 14:18:22 +0000 (+0100) Subject: make sure we always have the encryption key unlocked X-Git-Tag: v4.0.0beta~440^2~59 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ed0c99ef149d63a350c7ffcb87d398b90ed3b0a2;p=nextcloud-server.git make sure we always have the encryption key unlocked --- diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php index 82d2544dd14..23f3955aa40 100644 --- a/apps/files_encryption/appinfo/app.php +++ b/apps/files_encryption/appinfo/app.php @@ -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(); +}