@@ -21,25 +21,25 @@ |
||
| 21 | 21 | * @template-implements IEventListener<Event|SabrePluginAuthInitEvent> |
| 22 | 22 | */ |
| 23 | 23 | class SabrePluginAuthInitListener implements IEventListener { |
| 24 | - public function __construct( |
|
| 25 | - private readonly CalendarFederationConfig $calendarFederationConfig, |
|
| 26 | - ) { |
|
| 27 | - } |
|
| 28 | - |
|
| 29 | - public function handle(Event $event): void { |
|
| 30 | - if (!($event instanceof SabrePluginAuthInitEvent)) { |
|
| 31 | - return; |
|
| 32 | - } |
|
| 33 | - |
|
| 34 | - if (!$this->calendarFederationConfig->isFederationEnabled()) { |
|
| 35 | - return; |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - $server = $event->getServer(); |
|
| 39 | - $authPlugin = $server->getPlugin('auth'); |
|
| 40 | - if ($authPlugin instanceof Plugin) { |
|
| 41 | - $authBackend = Server::get(FederatedCalendarAuth::class); |
|
| 42 | - $authPlugin->addBackend($authBackend); |
|
| 43 | - } |
|
| 44 | - } |
|
| 24 | + public function __construct( |
|
| 25 | + private readonly CalendarFederationConfig $calendarFederationConfig, |
|
| 26 | + ) { |
|
| 27 | + } |
|
| 28 | + |
|
| 29 | + public function handle(Event $event): void { |
|
| 30 | + if (!($event instanceof SabrePluginAuthInitEvent)) { |
|
| 31 | + return; |
|
| 32 | + } |
|
| 33 | + |
|
| 34 | + if (!$this->calendarFederationConfig->isFederationEnabled()) { |
|
| 35 | + return; |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + $server = $event->getServer(); |
|
| 39 | + $authPlugin = $server->getPlugin('auth'); |
|
| 40 | + if ($authPlugin instanceof Plugin) { |
|
| 41 | + $authBackend = Server::get(FederatedCalendarAuth::class); |
|
| 42 | + $authPlugin->addBackend($authBackend); |
|
| 43 | + } |
|
| 44 | + } |
|
| 45 | 45 | } |