make sure we always have the encryption key unlocked

This commit is contained in:
Robin Appelman 2012-02-22 15:18:22 +01:00
parent 1a9ded981b
commit ed0c99ef14

View 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();
}