2011-10-21 15:02:11 +00:00
|
|
|
<?php
|
|
|
|
|
2013-03-02 11:18:28 +00:00
|
|
|
OC::$CLASSPATH['OCA\Encryption\Crypt'] = 'files_encryption/lib/crypt.php';
|
|
|
|
OC::$CLASSPATH['OCA\Encryption\Hooks'] = 'files_encryption/hooks/hooks.php';
|
|
|
|
OC::$CLASSPATH['OCA\Encryption\Util'] = 'files_encryption/lib/util.php';
|
|
|
|
OC::$CLASSPATH['OCA\Encryption\Keymanager'] = 'files_encryption/lib/keymanager.php';
|
|
|
|
OC::$CLASSPATH['OCA\Encryption\Stream'] = 'files_encryption/lib/stream.php';
|
|
|
|
OC::$CLASSPATH['OCA\Encryption\Proxy'] = 'files_encryption/lib/proxy.php';
|
|
|
|
OC::$CLASSPATH['OCA\Encryption\Session'] = 'files_encryption/lib/session.php';
|
2013-03-09 00:04:33 +00:00
|
|
|
OC::$CLASSPATH['OCA\Encryption\Capabilities'] = 'files_encryption/lib/capabilities.php';
|
2013-05-09 17:36:18 +00:00
|
|
|
OC::$CLASSPATH['OCA\Encryption\Helper'] = 'files_encryption/lib/helper.php';
|
2011-10-21 15:02:11 +00:00
|
|
|
|
2014-02-11 11:44:06 +00:00
|
|
|
\OCP\Util::addscript('files_encryption', 'encryption');
|
2013-11-25 22:49:05 +00:00
|
|
|
\OCP\Util::addscript('files_encryption', 'detect-migration');
|
|
|
|
|
2013-05-31 18:34:43 +00:00
|
|
|
if (!OC_Config::getValue('maintenance', false)) {
|
2013-05-30 20:41:30 +00:00
|
|
|
OC_FileProxy::register(new OCA\Encryption\Proxy());
|
2011-10-21 15:02:11 +00:00
|
|
|
|
2013-05-30 20:41:30 +00:00
|
|
|
// User related hooks
|
|
|
|
OCA\Encryption\Helper::registerUserHooks();
|
2011-10-21 15:02:11 +00:00
|
|
|
|
2013-05-30 20:41:30 +00:00
|
|
|
// Sharing related hooks
|
|
|
|
OCA\Encryption\Helper::registerShareHooks();
|
2013-01-14 19:07:28 +00:00
|
|
|
|
2013-05-30 20:41:30 +00:00
|
|
|
// Filesystem related hooks
|
|
|
|
OCA\Encryption\Helper::registerFilesystemHooks();
|
2013-04-27 18:18:05 +00:00
|
|
|
|
2013-06-27 12:09:22 +00:00
|
|
|
// App manager related hooks
|
|
|
|
OCA\Encryption\Helper::registerAppHooks();
|
|
|
|
|
2013-09-03 13:56:25 +00:00
|
|
|
if(!in_array('crypt', stream_get_wrappers())) {
|
|
|
|
stream_wrapper_register('crypt', 'OCA\Encryption\Stream');
|
|
|
|
}
|
2013-04-10 15:37:03 +00:00
|
|
|
|
2013-05-30 20:41:30 +00:00
|
|
|
// check if we are logged in
|
|
|
|
if (OCP\User::isLoggedIn()) {
|
2013-05-31 10:56:08 +00:00
|
|
|
|
2013-05-31 18:34:43 +00:00
|
|
|
// ensure filesystem is loaded
|
|
|
|
if (!\OC\Files\Filesystem::$loaded) {
|
|
|
|
\OC_Util::setupFS();
|
|
|
|
}
|
2013-05-31 10:56:08 +00:00
|
|
|
|
2014-05-12 14:30:39 +00:00
|
|
|
$view = new OC\Files\View('/');
|
2013-06-21 08:37:51 +00:00
|
|
|
|
2013-07-01 10:16:36 +00:00
|
|
|
$sessionReady = OCA\Encryption\Helper::checkRequirements();
|
|
|
|
if($sessionReady) {
|
2013-06-21 08:37:51 +00:00
|
|
|
$session = new \OCA\Encryption\Session($view);
|
|
|
|
}
|
2013-05-15 12:32:50 +00:00
|
|
|
}
|
2013-05-30 20:41:30 +00:00
|
|
|
} else {
|
|
|
|
// logout user if we are in maintenance to force re-login
|
|
|
|
OCP\User::logout();
|
2013-05-15 12:32:50 +00:00
|
|
|
}
|
2012-02-22 21:20:46 +00:00
|
|
|
|
2013-02-09 17:01:38 +00:00
|
|
|
// Register settings scripts
|
2013-05-27 15:26:58 +00:00
|
|
|
OCP\App::registerAdmin('files_encryption', 'settings-admin');
|
|
|
|
OCP\App::registerPersonal('files_encryption', 'settings-personal');
|