2011-10-21 19:02:11 +04:00
|
|
|
<?php
|
|
|
|
|
2012-07-25 19:51:48 +04:00
|
|
|
OC::$CLASSPATH['OCA_Encryption\Crypt'] = 'apps/files_encryption/lib/crypt.php';
|
|
|
|
OC::$CLASSPATH['OCA_Encryption\Hooks'] = 'apps/files_encryption/hooks/hooks.php';
|
|
|
|
OC::$CLASSPATH['OCA_Encryption\Util'] = 'apps/files_encryption/lib/util.php';
|
|
|
|
OC::$CLASSPATH['OCA_Encryption\Keymanager'] = 'apps/files_encryption/lib/keymanager.php';
|
2011-10-21 19:02:11 +04:00
|
|
|
OC::$CLASSPATH['OC_CryptStream'] = 'apps/files_encryption/lib/cryptstream.php';
|
2012-07-25 21:28:56 +04:00
|
|
|
OC::$CLASSPATH['OCA_Encryption\Proxy'] = 'apps/files_encryption/lib/proxy.php';
|
2011-10-21 19:02:11 +04:00
|
|
|
|
2012-07-25 21:28:56 +04:00
|
|
|
OC_FileProxy::register(new OCA_Encryption\Proxy());
|
2011-10-21 19:02:11 +04:00
|
|
|
|
2012-07-25 19:51:48 +04:00
|
|
|
OCP\Util::connectHook('OC_User','post_login','OCA_Encryption\Hooks','login');
|
2011-10-21 19:02:11 +04:00
|
|
|
|
|
|
|
stream_wrapper_register('crypt','OC_CryptStream');
|
2012-02-22 18:18:22 +04:00
|
|
|
|
2012-07-25 21:28:56 +04:00
|
|
|
if(
|
|
|
|
!isset( $_SESSION['enckey'] )
|
|
|
|
and OCP\User::isLoggedIn()
|
|
|
|
) {
|
|
|
|
|
|
|
|
// 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)
|
2012-05-01 21:04:20 +04:00
|
|
|
OCP\User::logout();
|
2012-07-25 21:28:56 +04:00
|
|
|
|
2012-02-22 18:18:22 +04:00
|
|
|
header("Location: ".OC::$WEBROOT.'/');
|
2012-07-25 21:28:56 +04:00
|
|
|
|
2012-02-22 18:18:22 +04:00
|
|
|
exit();
|
2012-07-25 21:28:56 +04:00
|
|
|
|
2012-02-22 18:18:22 +04:00
|
|
|
}
|
2012-02-23 01:20:46 +04:00
|
|
|
|
2012-07-25 21:28:56 +04:00
|
|
|
OCP\App::registerAdmin('files_encryption', 'settings');
|