|
|
|
|
@ -23,6 +23,7 @@ namespace OCA\Federation\AppInfo; |
|
|
|
|
|
|
|
|
|
use OCA\Federation\API\OCSAuthAPI; |
|
|
|
|
use OCA\Federation\Controller\SettingsController; |
|
|
|
|
use OCA\Federation\DAV\FedAuth; |
|
|
|
|
use OCA\Federation\DbHandler; |
|
|
|
|
use OCA\Federation\Hooks; |
|
|
|
|
use OCA\Federation\Middleware\AddServerMiddleware; |
|
|
|
|
@ -30,7 +31,9 @@ use OCA\Federation\TrustedServers; |
|
|
|
|
use OCP\API; |
|
|
|
|
use OCP\App; |
|
|
|
|
use OCP\AppFramework\IAppContainer; |
|
|
|
|
use OCP\SabrePluginEvent; |
|
|
|
|
use OCP\Util; |
|
|
|
|
use Sabre\DAV\Auth\Plugin; |
|
|
|
|
|
|
|
|
|
class Application extends \OCP\AppFramework\App { |
|
|
|
|
|
|
|
|
|
@ -144,6 +147,17 @@ class Application extends \OCP\AppFramework\App { |
|
|
|
|
$hooksManager, |
|
|
|
|
'addServerHook' |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$dispatcher = $this->getContainer()->getServer()->getEventDispatcher(); |
|
|
|
|
$dispatcher->addListener('OCA\DAV\Connector\Sabre::authInit', function($event) use($container) { |
|
|
|
|
if ($event instanceof SabrePluginEvent) { |
|
|
|
|
$authPlugin = $event->getServer()->getPlugin('auth'); |
|
|
|
|
if ($authPlugin instanceof Plugin) { |
|
|
|
|
$db = $container->getServer()->getDatabaseConnection(); |
|
|
|
|
$authPlugin->addBackend(new FedAuth($db)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|