Merge pull request #55633 from nextcloud/backport/55630/stable32

This commit is contained in:
Kate 2025-10-08 20:15:06 +02:00 committed by GitHub
commit 8e8b74bd7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,6 +9,7 @@ declare(strict_types=1);
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;
@ -20,11 +21,20 @@ use Sabre\DAV\Auth\Plugin;
* @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) {