@@ -33,7 +33,7 @@ |
||
33 | 33 | /** @var Application $app */ |
34 | 34 | $app = \OC::$server->query(Application::class); |
35 | 35 | if ($encryptionSystemReady) { |
36 | - $app->registerEncryptionModule($encryptionManager); |
|
37 | - $app->registerHooks(\OC::$server->getConfig()); |
|
38 | - $app->setUp($encryptionManager); |
|
36 | + $app->registerEncryptionModule($encryptionManager); |
|
37 | + $app->registerHooks(\OC::$server->getConfig()); |
|
38 | + $app->setUp($encryptionManager); |
|
39 | 39 | } |
@@ -44,67 +44,67 @@ |
||
44 | 44 | use OCP\IConfig; |
45 | 45 | |
46 | 46 | class Application extends \OCP\AppFramework\App { |
47 | - /** |
|
48 | - * @param array $urlParams |
|
49 | - */ |
|
50 | - public function __construct($urlParams = []) { |
|
51 | - parent::__construct('encryption', $urlParams); |
|
52 | - } |
|
47 | + /** |
|
48 | + * @param array $urlParams |
|
49 | + */ |
|
50 | + public function __construct($urlParams = []) { |
|
51 | + parent::__construct('encryption', $urlParams); |
|
52 | + } |
|
53 | 53 | |
54 | - public function setUp(IManager $encryptionManager) { |
|
55 | - if ($encryptionManager->isEnabled()) { |
|
56 | - /** @var Setup $setup */ |
|
57 | - $setup = $this->getContainer()->query(Setup::class); |
|
58 | - $setup->setupSystem(); |
|
59 | - } |
|
60 | - } |
|
54 | + public function setUp(IManager $encryptionManager) { |
|
55 | + if ($encryptionManager->isEnabled()) { |
|
56 | + /** @var Setup $setup */ |
|
57 | + $setup = $this->getContainer()->query(Setup::class); |
|
58 | + $setup->setupSystem(); |
|
59 | + } |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * register hooks |
|
64 | - */ |
|
65 | - public function registerHooks(IConfig $config) { |
|
66 | - if (!$config->getSystemValueBool('maintenance')) { |
|
67 | - $container = $this->getContainer(); |
|
68 | - $server = $container->getServer(); |
|
69 | - // Register our hooks and fire them. |
|
70 | - $hookManager = new HookManager(); |
|
62 | + /** |
|
63 | + * register hooks |
|
64 | + */ |
|
65 | + public function registerHooks(IConfig $config) { |
|
66 | + if (!$config->getSystemValueBool('maintenance')) { |
|
67 | + $container = $this->getContainer(); |
|
68 | + $server = $container->getServer(); |
|
69 | + // Register our hooks and fire them. |
|
70 | + $hookManager = new HookManager(); |
|
71 | 71 | |
72 | - $hookManager->registerHook([ |
|
73 | - new UserHooks($container->query(KeyManager::class), |
|
74 | - $server->getUserManager(), |
|
75 | - $server->getLogger(), |
|
76 | - $container->query(Setup::class), |
|
77 | - $server->getUserSession(), |
|
78 | - $container->query(Util::class), |
|
79 | - $container->query(Session::class), |
|
80 | - $container->query(Crypt::class), |
|
81 | - $container->query(Recovery::class)) |
|
82 | - ]); |
|
72 | + $hookManager->registerHook([ |
|
73 | + new UserHooks($container->query(KeyManager::class), |
|
74 | + $server->getUserManager(), |
|
75 | + $server->getLogger(), |
|
76 | + $container->query(Setup::class), |
|
77 | + $server->getUserSession(), |
|
78 | + $container->query(Util::class), |
|
79 | + $container->query(Session::class), |
|
80 | + $container->query(Crypt::class), |
|
81 | + $container->query(Recovery::class)) |
|
82 | + ]); |
|
83 | 83 | |
84 | - $hookManager->fireHooks(); |
|
85 | - } else { |
|
86 | - // Logout user if we are in maintenance to force re-login |
|
87 | - $this->getContainer()->getServer()->getUserSession()->logout(); |
|
88 | - } |
|
89 | - } |
|
84 | + $hookManager->fireHooks(); |
|
85 | + } else { |
|
86 | + // Logout user if we are in maintenance to force re-login |
|
87 | + $this->getContainer()->getServer()->getUserSession()->logout(); |
|
88 | + } |
|
89 | + } |
|
90 | 90 | |
91 | - public function registerEncryptionModule(IManager $encryptionManager) { |
|
92 | - $container = $this->getContainer(); |
|
91 | + public function registerEncryptionModule(IManager $encryptionManager) { |
|
92 | + $container = $this->getContainer(); |
|
93 | 93 | |
94 | - $encryptionManager->registerEncryptionModule( |
|
95 | - Encryption::ID, |
|
96 | - Encryption::DISPLAY_NAME, |
|
97 | - function () use ($container) { |
|
98 | - return new Encryption( |
|
99 | - $container->query(Crypt::class), |
|
100 | - $container->query(KeyManager::class), |
|
101 | - $container->query(Util::class), |
|
102 | - $container->query(Session::class), |
|
103 | - $container->query(EncryptAll::class), |
|
104 | - $container->query(DecryptAll::class), |
|
105 | - $container->getServer()->getLogger(), |
|
106 | - $container->getServer()->getL10N($container->getAppName()) |
|
107 | - ); |
|
108 | - }); |
|
109 | - } |
|
94 | + $encryptionManager->registerEncryptionModule( |
|
95 | + Encryption::ID, |
|
96 | + Encryption::DISPLAY_NAME, |
|
97 | + function () use ($container) { |
|
98 | + return new Encryption( |
|
99 | + $container->query(Crypt::class), |
|
100 | + $container->query(KeyManager::class), |
|
101 | + $container->query(Util::class), |
|
102 | + $container->query(Session::class), |
|
103 | + $container->query(EncryptAll::class), |
|
104 | + $container->query(DecryptAll::class), |
|
105 | + $container->getServer()->getLogger(), |
|
106 | + $container->getServer()->getL10N($container->getAppName()) |
|
107 | + ); |
|
108 | + }); |
|
109 | + } |
|
110 | 110 | } |
@@ -94,7 +94,7 @@ |
||
94 | 94 | $encryptionManager->registerEncryptionModule( |
95 | 95 | Encryption::ID, |
96 | 96 | Encryption::DISPLAY_NAME, |
97 | - function () use ($container) { |
|
97 | + function() use ($container) { |
|
98 | 98 | return new Encryption( |
99 | 99 | $container->query(Crypt::class), |
100 | 100 | $container->query(KeyManager::class), |