|
28 | 28 | use OCA\Registration\Events\ShowFormEvent; |
29 | 29 | use OCA\Registration\Events\ValidateFormEvent; |
30 | 30 | use OCA\TermsOfService\Checker; |
| 31 | +use OCA\TermsOfService\Dav\CheckPlugin; |
31 | 32 | use OCA\TermsOfService\Filesystem\StorageWrapper; |
32 | 33 | use OCA\TermsOfService\Listener\RegistrationIntegration; |
33 | 34 | use OCA\TermsOfService\Listener\UserDeletedListener; |
@@ -74,19 +75,18 @@ public function register(IRegistrationContext $context): void { |
74 | 75 | public function boot(IBootContext $context): void { |
75 | 76 | Util::connectHook('OC_Filesystem', 'preSetup', $this, 'addStorageWrapper'); |
76 | 77 |
|
77 | | - // FIXME currently disabled until we made sure all clients (Talk and files on Android and iOS, as well as desktop) handle this gracefully |
78 | | -// $eventDispatcher = $context->getServerContainer()->get(IEventDispatcher::class); |
79 | | -// $eventDispatcher->addListener('OCA\DAV\Connector\Sabre::addPlugin', function (SabrePluginEvent $event) use ($context) { |
80 | | -// $eventServer = $event->getServer(); |
81 | | -// |
82 | | -// if ($eventServer !== null) { |
83 | | -// // We have to register the CheckPlugin here and not info.xml, |
84 | | -// // because info.xml plugins are loaded, after the |
85 | | -// // beforeMethod:* hook has already been emitted. |
86 | | -// $plugin = $context->getAppContainer()->get(CheckPlugin::class); |
87 | | -// $eventServer->addPlugin($plugin); |
88 | | -// } |
89 | | -// }); |
| 78 | + $eventDispatcher = $context->getServerContainer()->get(IEventDispatcher::class); |
| 79 | + $eventDispatcher->addListener('OCA\DAV\Connector\Sabre::addPlugin', function (SabrePluginEvent $event) use ($context) { |
| 80 | + $eventServer = $event->getServer(); |
| 81 | + |
| 82 | + if ($eventServer !== null) { |
| 83 | + // We have to register the CheckPlugin here and not info.xml, |
| 84 | + // because info.xml plugins are loaded, after the |
| 85 | + // beforeMethod:* hook has already been emitted. |
| 86 | + $plugin = $context->getAppContainer()->get(CheckPlugin::class); |
| 87 | + $eventServer->addPlugin($plugin); |
| 88 | + } |
| 89 | + }); |
90 | 90 |
|
91 | 91 | $context->injectFn([$this, 'registerNotifier']); |
92 | 92 | $context->injectFn([$this, 'createNotificationOnFirstLogin']); |
|
0 commit comments