Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions apps/dav/lib/Listener/SabrePluginAuthInitListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace OCA\DAV\Listener;

use OCA\DAV\CalDAV\Federation\CalendarFederationConfig;
use OCA\DAV\CalDAV\Federation\FederatedCalendarAuth;
use OCA\DAV\Events\SabrePluginAuthInitEvent;
use OCP\EventDispatcher\Event;
Expand All @@ -20,11 +21,20 @@
* @template-implements IEventListener<Event|SabrePluginAuthInitEvent>
*/
class SabrePluginAuthInitListener implements IEventListener {
public function __construct(
private readonly CalendarFederationConfig $calendarFederationConfig,
) {
}

public function handle(Event $event): void {
if (!($event instanceof SabrePluginAuthInitEvent)) {
return;
}

if (!$this->calendarFederationConfig->isFederationEnabled()) {
return;
}

$server = $event->getServer();
$authPlugin = $server->getPlugin('auth');
if ($authPlugin instanceof Plugin) {
Expand Down
Loading