mirror of
https://github.com/nextcloud/server.git
synced 2026-03-31 06:36:18 -04:00
Merge pull request #55633 from nextcloud/backport/55630/stable32
This commit is contained in:
commit
8e8b74bd7d
1 changed files with 10 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue