|
|
|
@ -10,39 +10,44 @@ OC::$CLASSPATH['OCA\Encryption\Session'] = 'files_encryption/lib/session.php'; |
|
|
|
|
OC::$CLASSPATH['OCA\Encryption\Capabilities'] = 'files_encryption/lib/capabilities.php'; |
|
|
|
|
OC::$CLASSPATH['OCA\Encryption\Helper'] = 'files_encryption/lib/helper.php'; |
|
|
|
|
|
|
|
|
|
OC_FileProxy::register(new OCA\Encryption\Proxy()); |
|
|
|
|
if(!OC_Config::getValue('maintenance', false)) { |
|
|
|
|
OC_FileProxy::register(new OCA\Encryption\Proxy()); |
|
|
|
|
|
|
|
|
|
// User related hooks |
|
|
|
|
OCA\Encryption\Helper::registerUserHooks(); |
|
|
|
|
// User related hooks |
|
|
|
|
OCA\Encryption\Helper::registerUserHooks(); |
|
|
|
|
|
|
|
|
|
// Sharing related hooks |
|
|
|
|
OCA\Encryption\Helper::registerShareHooks(); |
|
|
|
|
// Sharing related hooks |
|
|
|
|
OCA\Encryption\Helper::registerShareHooks(); |
|
|
|
|
|
|
|
|
|
// Filesystem related hooks |
|
|
|
|
OCA\Encryption\Helper::registerFilesystemHooks(); |
|
|
|
|
// Filesystem related hooks |
|
|
|
|
OCA\Encryption\Helper::registerFilesystemHooks(); |
|
|
|
|
|
|
|
|
|
stream_wrapper_register('crypt', 'OCA\Encryption\Stream'); |
|
|
|
|
stream_wrapper_register('crypt', 'OCA\Encryption\Stream'); |
|
|
|
|
|
|
|
|
|
// check if we are logged in |
|
|
|
|
if (OCP\User::isLoggedIn()) { |
|
|
|
|
$view = new OC_FilesystemView('/'); |
|
|
|
|
$session = new \OCA\Encryption\Session($view); |
|
|
|
|
// check if we are logged in |
|
|
|
|
if (OCP\User::isLoggedIn()) { |
|
|
|
|
$view = new OC_FilesystemView('/'); |
|
|
|
|
$session = new \OCA\Encryption\Session($view); |
|
|
|
|
|
|
|
|
|
// check if user has a private key |
|
|
|
|
if ( |
|
|
|
|
!$session->getPrivateKey(\OCP\USER::getUser()) |
|
|
|
|
&& OCA\Encryption\Crypt::mode() === 'server' |
|
|
|
|
) { |
|
|
|
|
// check if user has a private key |
|
|
|
|
if ( |
|
|
|
|
!$session->getPrivateKey(\OCP\USER::getUser()) |
|
|
|
|
&& OCA\Encryption\Crypt::mode() === 'server' |
|
|
|
|
) { |
|
|
|
|
|
|
|
|
|
// Force the user to log-in again if the encryption key isn't unlocked |
|
|
|
|
// (happens when a user is logged in before the encryption app is |
|
|
|
|
// enabled) |
|
|
|
|
OCP\User::logout(); |
|
|
|
|
// Force the user to log-in again if the encryption key isn't unlocked |
|
|
|
|
// (happens when a user is logged in before the encryption app is |
|
|
|
|
// enabled) |
|
|
|
|
OCP\User::logout(); |
|
|
|
|
|
|
|
|
|
header("Location: " . OC::$WEBROOT . '/'); |
|
|
|
|
header("Location: " . OC::$WEBROOT . '/'); |
|
|
|
|
|
|
|
|
|
exit(); |
|
|
|
|
exit(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// logout user if we are in maintenance to force re-login |
|
|
|
|
OCP\User::logout(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Register settings scripts |
|
|
|
|