diff options
Diffstat (limited to 'apps/federation/appinfo')
-rw-r--r-- | apps/federation/appinfo/application.php | 16 | ||||
-rw-r--r-- | apps/federation/appinfo/database.xml | 8 | ||||
-rw-r--r-- | apps/federation/appinfo/info.xml | 5 | ||||
-rw-r--r-- | apps/federation/appinfo/register_command.php | 8 |
4 files changed, 35 insertions, 2 deletions
diff --git a/apps/federation/appinfo/application.php b/apps/federation/appinfo/application.php index 45d88548b70..0214d73d900 100644 --- a/apps/federation/appinfo/application.php +++ b/apps/federation/appinfo/application.php @@ -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,19 @@ 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) { + $h = new DbHandler($container->getServer()->getDatabaseConnection(), + $container->getServer()->getL10N('federation') + ); + $authPlugin->addBackend(new FedAuth($h)); + } + } + }); } } diff --git a/apps/federation/appinfo/database.xml b/apps/federation/appinfo/database.xml index e0bb241918e..05b7fb12b49 100644 --- a/apps/federation/appinfo/database.xml +++ b/apps/federation/appinfo/database.xml @@ -34,7 +34,7 @@ <name>token</name> <type>text</type> <length>128</length> - <comments>toke used to exchange the shared secret</comments> + <comments>token used to exchange the shared secret</comments> </field> <field> <name>shared_secret</name> @@ -50,6 +50,12 @@ <default>2</default> <comments>current status of the connection</comments> </field> + <field> + <name>sync_token</name> + <type>text</type> + <length>512</length> + <comments>cardDav sync token</comments> + </field> <index> <name>url_hash</name> <unique>true</unique> diff --git a/apps/federation/appinfo/info.xml b/apps/federation/appinfo/info.xml index 92afc995366..54ea4831be0 100644 --- a/apps/federation/appinfo/info.xml +++ b/apps/federation/appinfo/info.xml @@ -5,10 +5,13 @@ <description>ownCloud Federation allows you to connect with other trusted ownClouds to exchange the user directory. For example this will be used to auto-complete external users for federated sharing.</description> <licence>AGPL</licence> <author>Bjoern Schiessle</author> - <version>0.0.1</version> + <version>0.0.2</version> <namespace>Federation</namespace> <category>other</category> <dependencies> <owncloud min-version="9.0" max-version="9.0" /> </dependencies> + <types> + <authentication/> + </types> </info> diff --git a/apps/federation/appinfo/register_command.php b/apps/federation/appinfo/register_command.php new file mode 100644 index 00000000000..541b01706d0 --- /dev/null +++ b/apps/federation/appinfo/register_command.php @@ -0,0 +1,8 @@ +<?php + +$dbConnection = \OC::$server->getDatabaseConnection(); +$l10n = \OC::$server->getL10N('federation'); +$dbHandler = new \OCA\Federation\DbHandler($dbConnection, $l10n); + +/** @var Symfony\Component\Console\Application $application */ +$application->add(new \OCA\Federation\Command\SyncFederationAddressBooks($dbHandler)); |