2011-10-21 15:02:11 +00:00
< ? php
OC :: $CLASSPATH [ 'OC_Crypt' ] = 'apps/files_encryption/lib/crypt.php' ;
OC :: $CLASSPATH [ 'OC_CryptStream' ] = 'apps/files_encryption/lib/cryptstream.php' ;
OC :: $CLASSPATH [ 'OC_FileProxy_Encryption' ] = 'apps/files_encryption/lib/proxy.php' ;
OC_FileProxy :: register ( new OC_FileProxy_Encryption ());
2012-05-05 08:18:45 +00:00
OCP\Util :: connectHook ( 'OC_User' , 'post_login' , 'OC_Crypt' , 'loginListener' );
2011-10-21 15:02:11 +00:00
stream_wrapper_register ( 'crypt' , 'OC_CryptStream' );
2012-02-22 14:18:22 +00:00
2012-05-01 16:46:15 +00:00
if ( ! isset ( $_SESSION [ 'enckey' ]) and OCP\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)
2012-05-01 17:04:20 +00:00
OCP\User :: logout ();
2012-02-22 14:18:22 +00:00
header ( " Location: " . OC :: $WEBROOT . '/' );
exit ();
}
2012-02-22 21:20:46 +00:00
2012-05-01 22:50:26 +00:00
OCP\App :: registerAdmin ( 'files_encryption' , 'settings' );