aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/appinfo
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/appinfo')
-rw-r--r--apps/files_sharing/appinfo/app.php127
-rw-r--r--apps/files_sharing/appinfo/application.php142
-rw-r--r--apps/files_sharing/appinfo/database.xml109
-rw-r--r--apps/files_sharing/appinfo/info.xml85
-rw-r--r--apps/files_sharing/appinfo/install.php24
-rw-r--r--apps/files_sharing/appinfo/routes.php300
-rw-r--r--apps/files_sharing/appinfo/update.php36
7 files changed, 250 insertions, 573 deletions
diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php
deleted file mode 100644
index 29202c15b22..00000000000
--- a/apps/files_sharing/appinfo/app.php
+++ /dev/null
@@ -1,127 +0,0 @@
-<?php
-/**
- * @author Arthur Schiwon <blizzz@owncloud.com>
- * @author Björn Schießle <schiessle@owncloud.com>
- * @author Gadzy <dev@gadzy.fr>
- * @author Joas Schilling <nickvergessen@owncloud.com>
- * @author Michael Gapczynski <GapczynskiM@gmail.com>
- * @author Robin Appelman <icewind@owncloud.com>
- * @author Roeland Jago Douma <rullzer@owncloud.com>
- * @author Vincent Petry <pvince81@owncloud.com>
- *
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-namespace OCA\Files_Sharing\Appinfo;
-
-$l = \OC::$server->getL10N('files_sharing');
-
-\OC::$CLASSPATH['OC_Share_Backend_File'] = 'files_sharing/lib/share/file.php';
-\OC::$CLASSPATH['OC_Share_Backend_Folder'] = 'files_sharing/lib/share/folder.php';
-\OC::$CLASSPATH['OC\Files\Storage\Shared'] = 'files_sharing/lib/sharedstorage.php';
-\OC::$CLASSPATH['OC\Files\Cache\SharedScanner'] = 'files_sharing/lib/scanner.php';
-\OC::$CLASSPATH['OC\Files\Cache\Shared_Cache'] = 'files_sharing/lib/cache.php';
-\OC::$CLASSPATH['OC\Files\Cache\Shared_Permissions'] = 'files_sharing/lib/permissions.php';
-\OC::$CLASSPATH['OC\Files\Cache\Shared_Updater'] = 'files_sharing/lib/updater.php';
-\OC::$CLASSPATH['OC\Files\Cache\Shared_Watcher'] = 'files_sharing/lib/watcher.php';
-\OC::$CLASSPATH['OCA\Files\Share\Maintainer'] = 'files_sharing/lib/maintainer.php';
-\OC::$CLASSPATH['OCA\Files\Share\Proxy'] = 'files_sharing/lib/proxy.php';
-
-$application = new Application();
-$application->registerMountProviders();
-
-\OCP\App::registerAdmin('files_sharing', 'settings-admin');
-\OCP\App::registerPersonal('files_sharing', 'settings-personal');
-
-\OCA\Files_Sharing\Helper::registerHooks();
-
-\OCP\Share::registerBackend('file', 'OC_Share_Backend_File');
-\OCP\Share::registerBackend('folder', 'OC_Share_Backend_Folder', 'file');
-
-$eventDispatcher = \OC::$server->getEventDispatcher();
-$eventDispatcher->addListener(
- 'OCA\Files::loadAdditionalScripts',
- function() {
- \OCP\Util::addScript('files_sharing', 'share');
- \OCP\Util::addScript('files_sharing', 'sharetabview');
- if (\OC::$server->getConfig()->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'yes') {
- \OCP\Util::addScript('files_sharing', 'external');
- }
- \OCP\Util::addStyle('files_sharing', 'sharetabview');
- }
-);
-
-// \OCP\Util::addStyle('files_sharing', 'sharetabview');
-
-\OC::$server->getActivityManager()->registerExtension(function() {
- return new \OCA\Files_Sharing\Activity(
- \OC::$server->query('L10NFactory'),
- \OC::$server->getURLGenerator(),
- \OC::$server->getActivityManager()
- );
-});
-
-$config = \OC::$server->getConfig();
-if ($config->getAppValue('core', 'shareapi_enabled', 'yes') === 'yes') {
-
- \OCA\Files\App::getNavigationManager()->add(
- array(
- "id" => 'sharingin',
- "appname" => 'files_sharing',
- "script" => 'list.php',
- "order" => 10,
- "name" => $l->t('Shared with you')
- )
- );
-
- if (\OCP\Util::isSharingDisabledForUser() === false) {
-
- \OCA\Files\App::getNavigationManager()->add(
- array(
- "id" => 'sharingout',
- "appname" => 'files_sharing',
- "script" => 'list.php',
- "order" => 15,
- "name" => $l->t('Shared with others')
- )
- );
- // Check if sharing by link is enabled
- if ($config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') {
- \OCA\Files\App::getNavigationManager()->add(
- array(
- "id" => 'sharinglinks',
- "appname" => 'files_sharing',
- "script" => 'list.php',
- "order" => 20,
- "name" => $l->t('Shared by link')
- )
- );
- }
- }
-}
-
-$manager = \OC::$server->getNotificationManager();
-$manager->registerNotifier(function() {
- return new \OCA\Files_Sharing\Notifier(
- \OC::$server->getL10NFactory()
- );
-}, function() use ($l) {
- return [
- 'id' => 'files_sharing',
- 'name' => $l->t('Federated sharing'),
- ];
-});
diff --git a/apps/files_sharing/appinfo/application.php b/apps/files_sharing/appinfo/application.php
deleted file mode 100644
index 64c7517456d..00000000000
--- a/apps/files_sharing/appinfo/application.php
+++ /dev/null
@@ -1,142 +0,0 @@
-<?php
-/**
- * @author Joas Schilling <nickvergessen@owncloud.com>
- * @author Lukas Reschke <lukas@owncloud.com>
- * @author Robin Appelman <icewind@owncloud.com>
- * @author Roeland Jago Douma <rullzer@owncloud.com>
- *
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-namespace OCA\Files_Sharing\AppInfo;
-
-use OCA\FederatedFileSharing\DiscoveryManager;
-use OCA\Files_Sharing\MountProvider;
-use OCP\AppFramework\App;
-use OC\AppFramework\Utility\SimpleContainer;
-use OCA\Files_Sharing\Controllers\ExternalSharesController;
-use OCA\Files_Sharing\Controllers\ShareController;
-use OCA\Files_Sharing\Middleware\SharingCheckMiddleware;
-use \OCP\IContainer;
-use OCA\Files_Sharing\Capabilities;
-
-class Application extends App {
- public function __construct(array $urlParams = array()) {
- parent::__construct('files_sharing', $urlParams);
-
- $container = $this->getContainer();
- $server = $container->getServer();
-
- /**
- * Controllers
- */
- $container->registerService('ShareController', function (SimpleContainer $c) use ($server) {
- return new ShareController(
- $c->query('AppName'),
- $c->query('Request'),
- $server->getConfig(),
- $server->getURLGenerator(),
- $server->getUserManager(),
- $server->getLogger(),
- $server->getActivityManager(),
- $server->getShareManager(),
- $server->getSession(),
- $server->getPreviewManager(),
- $server->getRootFolder()
- );
- });
- $container->registerService('ExternalSharesController', function (SimpleContainer $c) {
- return new ExternalSharesController(
- $c->query('AppName'),
- $c->query('Request'),
- $c->query('ExternalManager'),
- $c->query('HttpClientService')
- );
- });
-
- /**
- * Core class wrappers
- */
- $container->registerService('HttpClientService', function (SimpleContainer $c) use ($server) {
- return $server->getHTTPClientService();
- });
- $container->registerService('ExternalManager', function (SimpleContainer $c) use ($server) {
- $user = $server->getUserSession()->getUser();
- $uid = $user ? $user->getUID() : null;
- $discoveryManager = new DiscoveryManager(
- \OC::$server->getMemCacheFactory(),
- \OC::$server->getHTTPClientService()
- );
- return new \OCA\Files_Sharing\External\Manager(
- $server->getDatabaseConnection(),
- \OC\Files\Filesystem::getMountManager(),
- \OC\Files\Filesystem::getLoader(),
- $server->getHTTPHelper(),
- $server->getNotificationManager(),
- $discoveryManager,
- $uid
- );
- });
-
- /**
- * Middleware
- */
- $container->registerService('SharingCheckMiddleware', function (SimpleContainer $c) use ($server) {
- return new SharingCheckMiddleware(
- $c->query('AppName'),
- $server->getConfig(),
- $server->getAppManager(),
- $c['ControllerMethodReflector']
- );
- });
-
- // Execute middlewares
- $container->registerMiddleware('SharingCheckMiddleware');
-
- $container->registerService('MountProvider', function (IContainer $c) {
- /** @var \OCP\IServerContainer $server */
- $server = $c->query('ServerContainer');
- return new MountProvider(
- $server->getConfig()
- );
- });
-
- $container->registerService('ExternalMountProvider', function (IContainer $c) {
- /** @var \OCP\IServerContainer $server */
- $server = $c->query('ServerContainer');
- return new \OCA\Files_Sharing\External\MountProvider(
- $server->getDatabaseConnection(),
- function() use ($c) {
- return $c->query('ExternalManager');
- }
- );
- });
-
- /*
- * Register capabilities
- */
- $container->registerCapability('OCA\Files_Sharing\Capabilities');
- }
-
- public function registerMountProviders() {
- /** @var \OCP\IServerContainer $server */
- $server = $this->getContainer()->query('ServerContainer');
- $mountProviderCollection = $server->getMountProviderCollection();
- $mountProviderCollection->registerProvider($this->getContainer()->query('MountProvider'));
- $mountProviderCollection->registerProvider($this->getContainer()->query('ExternalMountProvider'));
- }
-}
diff --git a/apps/files_sharing/appinfo/database.xml b/apps/files_sharing/appinfo/database.xml
deleted file mode 100644
index a70be408da4..00000000000
--- a/apps/files_sharing/appinfo/database.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<database>
- <name>*dbname*</name>
- <create>true</create>
- <overwrite>false</overwrite>
- <charset>utf8</charset>
- <table>
- <name>*dbprefix*share_external</name>
- <declaration>
- <field>
- <name>id</name>
- <type>integer</type>
- <default>0</default>
- <notnull>true</notnull>
- <autoincrement>1</autoincrement>
- <length>4</length>
- </field>
- <field>
- <name>remote</name>
- <type>text</type>
- <notnull>true</notnull>
- <length>512</length>
- <comments>Url of the remove owncloud instance</comments>
- </field>
- <field>
- <name>remote_id</name>
- <type>integer</type>
- <default>-1</default>
- <notnull>true</notnull>
- <length>4</length>
- </field>
- <field>
- <name>share_token</name>
- <type>text</type>
- <notnull>true</notnull>
- <length>64</length>
- <comments>Public share token</comments>
- </field>
- <field>
- <name>password</name>
- <type>text</type>
- <notnull>false</notnull>
- <length>64</length>
- <comments>Optional password for the public share</comments>
- </field>
- <field>
- <name>name</name>
- <type>text</type>
- <notnull>true</notnull>
- <length>64</length>
- <comments>Original name on the remote server</comments>
- </field>
- <field>
- <name>owner</name>
- <type>text</type>
- <notnull>true</notnull>
- <length>64</length>
- <comments>User that owns the public share on the remote server</comments>
- </field>
- <field>
- <name>user</name>
- <type>text</type>
- <notnull>true</notnull>
- <length>64</length>
- <comments>Local user which added the external share</comments>
- </field>
- <field>
- <name>mountpoint</name>
- <type>text</type>
- <notnull>true</notnull>
- <length>4000</length>
- <comments>Full path where the share is mounted</comments>
- </field>
- <field>
- <name>mountpoint_hash</name>
- <type>text</type>
- <notnull>true</notnull>
- <length>32</length>
- <comments>md5 hash of the mountpoint</comments>
- </field>
- <field>
- <name>accepted</name>
- <type>integer</type>
- <default>0</default>
- <notnull>true</notnull>
- <length>4</length>
- </field>
- <index>
- <name>sh_external_user</name>
- <field>
- <name>user</name>
- <sorting>ascending</sorting>
- </field>
- </index>
- <index>
- <name>sh_external_mp</name>
- <unique>true</unique>
- <field>
- <name>user</name>
- <sorting>ascending</sorting>
- </field>
- <field>
- <name>mountpoint_hash</name>
- <sorting>ascending</sorting>
- </field>
- </index>
- </declaration>
- </table>
-</database>
diff --git a/apps/files_sharing/appinfo/info.xml b/apps/files_sharing/appinfo/info.xml
index 6b09e73a022..03078b54040 100644
--- a/apps/files_sharing/appinfo/info.xml
+++ b/apps/files_sharing/appinfo/info.xml
@@ -1,22 +1,89 @@
<?xml version="1.0"?>
-<info>
+<!--
+ - SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ - SPDX-FileCopyrightText: 2011-2016 owncloud, Inc.
+ - SPDX-License-Identifier: AGPL-3.0-only
+-->
+<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>files_sharing</id>
- <name>Share Files</name>
+ <name>File sharing</name>
+ <summary>File sharing</summary>
<description>
- This application enables users to share files within ownCloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within ownCloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of ownCloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.
-Turning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the ownCloud Documentation.
+ This application enables people to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable people can then share files and folders with other accounts and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other people outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.
+Turning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation.
</description>
- <licence>AGPL</licence>
- <author>Michael Gapczynski, Bjoern Schiessle</author>
- <default_enable/>
- <version>0.10.0</version>
+ <version>1.24.0</version>
+ <licence>agpl</licence>
+ <author>Michael Gapczynski</author>
+ <author>Bjoern Schiessle</author>
+ <namespace>Files_Sharing</namespace>
<types>
<filesystem/>
</types>
+
+ <category>files</category>
+ <category>social</category>
+ <bugs>https://github.com/nextcloud/server/issues</bugs>
<dependencies>
- <owncloud min-version="9.1" max-version="9.1" />
+ <nextcloud min-version="32" max-version="32"/>
</dependencies>
+
+ <background-jobs>
+ <job>OCA\Files_Sharing\DeleteOrphanedSharesJob</job>
+ <job>OCA\Files_Sharing\ExpireSharesJob</job>
+ <job>OCA\Files_Sharing\SharesReminderJob</job>
+ <job>OCA\Files_Sharing\BackgroundJob\FederatedSharesDiscoverJob</job>
+ </background-jobs>
+
+ <repair-steps>
+ <post-migration>
+ <step>OCA\Files_Sharing\Migration\OwncloudGuestShareType</step>
+ <step>OCA\Files_Sharing\Migration\SetPasswordColumn</step>
+ <step>OCA\Files_Sharing\Migration\SetAcceptedStatus</step>
+ </post-migration>
+ </repair-steps>
+
+ <commands>
+ <command>OCA\Files_Sharing\Command\CleanupRemoteStorages</command>
+ <command>OCA\Files_Sharing\Command\ExiprationNotification</command>
+ <command>OCA\Files_Sharing\Command\DeleteOrphanShares</command>
+ <command>OCA\Files_Sharing\Command\FixShareOwners</command>
+ <command>OCA\Files_Sharing\Command\ListShares</command>
+ </commands>
+
+ <settings>
+ <personal>OCA\Files_Sharing\Settings\Personal</personal>
+ </settings>
+
+ <activity>
+ <settings>
+ <setting>OCA\Files_Sharing\Activity\Settings\Shared</setting>
+ <setting>OCA\Files_Sharing\Activity\Settings\RemoteShare</setting>
+ <setting>OCA\Files_Sharing\Activity\Settings\PublicLinks</setting>
+ <setting>OCA\Files_Sharing\Activity\Settings\PublicLinksUpload</setting>
+ </settings>
+
+ <filters>
+ <filter>OCA\Files_Sharing\Activity\Filter</filter>
+ </filters>
+
+ <providers>
+ <provider>OCA\Files_Sharing\Activity\Providers\Downloads</provider>
+ <provider>OCA\Files_Sharing\Activity\Providers\Groups</provider>
+ <provider>OCA\Files_Sharing\Activity\Providers\PublicLinks</provider>
+ <provider>OCA\Files_Sharing\Activity\Providers\RemoteShares</provider>
+ <provider>OCA\Files_Sharing\Activity\Providers\Users</provider>
+ </providers>
+ </activity>
+
+ <collaboration>
+ <plugins>
+ <plugin type="autocomplete-sort">OCA\Files_Sharing\Collaboration\ShareRecipientSorter</plugin>
+ </plugins>
+ </collaboration>
+
<public>
<files>public.php</files>
</public>
diff --git a/apps/files_sharing/appinfo/install.php b/apps/files_sharing/appinfo/install.php
deleted file mode 100644
index 33bbc8e2a84..00000000000
--- a/apps/files_sharing/appinfo/install.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/**
- * @author Joas Schilling <nickvergessen@owncloud.com>
- * @author Morris Jobke <hey@morrisjobke.de>
- *
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-\OC::$server->getJobList()->add('OCA\Files_sharing\Lib\DeleteOrphanedSharesJob');
-\OC::$server->getJobList()->add('OCA\Files_sharing\ExpireSharesJob');
diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php
index 80632f0fedf..f9e10ebb106 100644
--- a/apps/files_sharing/appinfo/routes.php
+++ b/apps/files_sharing/appinfo/routes.php
@@ -1,136 +1,184 @@
<?php
+
/**
- * @author Björn Schießle <schiessle@owncloud.com>
- * @author Georg Ehrke <georg@owncloud.com>
- * @author Joas Schilling <nickvergessen@owncloud.com>
- * @author Lukas Reschke <lukas@owncloud.com>
- * @author Robin Appelman <icewind@owncloud.com>
- * @author Roeland Jago Douma <rullzer@owncloud.com>
- * @author Thomas Müller <thomas.mueller@tmit.eu>
- *
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
-namespace OCA\Files_Sharing\AppInfo;
-
-use OCP\API;
-
-$application = new Application();
-$application->registerRoutes($this, [
+return [
'resources' => [
'ExternalShares' => ['url' => '/api/externalShares'],
],
'routes' => [
[
- 'name' => 'externalShares#testRemote',
- 'url' => '/testremote',
- 'verb' => 'GET'
+ 'name' => 'Share#showShare',
+ 'url' => '/s/{token}',
+ 'verb' => 'GET',
+ 'root' => '',
+ ],
+ [
+ 'name' => 'Share#showAuthenticate',
+ 'url' => '/s/{token}/authenticate/{redirect}',
+ 'verb' => 'GET',
+ 'root' => '',
+ ],
+ [
+ 'name' => 'Share#authenticate',
+ 'url' => '/s/{token}/authenticate/{redirect}',
+ 'verb' => 'POST',
+ 'root' => '',
+ ],
+ [
+ 'name' => 'Share#downloadShare',
+ 'url' => '/s/{token}/download/{filename}',
+ 'verb' => 'GET',
+ 'root' => '',
+ 'defaults' => ['filename' => '']
+ ],
+ [
+ 'name' => 'PublicPreview#directLink',
+ 'url' => '/s/{token}/preview',
+ 'verb' => 'GET',
+ 'root' => '',
+ ],
+ [
+ 'name' => 'PublicPreview#getPreview',
+ 'url' => '/publicpreview/{token}',
+ 'verb' => 'GET',
+ ],
+ [
+ 'name' => 'ShareInfo#info',
+ 'url' => '/shareinfo',
+ 'verb' => 'POST',
+ ],
+ [
+ 'name' => 'Settings#setDefaultAccept',
+ 'url' => '/settings/defaultAccept',
+ 'verb' => 'PUT',
+ ],
+ [
+ 'name' => 'Settings#setUserShareFolder',
+ 'url' => '/settings/shareFolder',
+ 'verb' => 'PUT',
+ ],
+ [
+ 'name' => 'Settings#resetUserShareFolder',
+ 'url' => '/settings/shareFolder',
+ 'verb' => 'DELETE',
+ ],
+ [
+ 'name' => 'Accept#accept',
+ 'url' => '/accept/{shareId}',
+ 'verb' => 'GET',
],
],
-]);
-
-/** @var $this \OCP\Route\IRouter */
-$this->create('core_ajax_public_preview', '/publicpreview')->action(
- function() {
- require_once __DIR__ . '/../ajax/publicpreview.php';
- });
-
-$this->create('files_sharing_ajax_list', 'ajax/list.php')
- ->actionInclude('files_sharing/ajax/list.php');
-$this->create('files_sharing_ajax_publicpreview', 'ajax/publicpreview.php')
- ->actionInclude('files_sharing/ajax/publicpreview.php');
-$this->create('sharing_external_shareinfo', '/shareinfo')
- ->actionInclude('files_sharing/ajax/shareinfo.php');
-$this->create('sharing_external_add', '/external')
- ->actionInclude('files_sharing/ajax/external.php');
-
-// OCS API
-
-//TODO: SET: mail notification, waiting for PR #4689 to be accepted
-
-$OCSShare = new \OCA\Files_Sharing\API\OCSShareWrapper();
-
-API::register('get',
- '/apps/files_sharing/api/v1/shares',
- [$OCSShare, 'getAllShares'],
- 'files_sharing');
-
-API::register('post',
- '/apps/files_sharing/api/v1/shares',
- [$OCSShare, 'createShare'],
- 'files_sharing');
-
-API::register('get',
- '/apps/files_sharing/api/v1/shares/{id}',
- [$OCSShare, 'getShare'],
- 'files_sharing');
-
-API::register('put',
- '/apps/files_sharing/api/v1/shares/{id}',
- [$OCSShare, 'updateShare'],
- 'files_sharing');
-
-API::register('delete',
- '/apps/files_sharing/api/v1/shares/{id}',
- [$OCSShare, 'deleteShare'],
- 'files_sharing');
-
-API::register('get',
- '/apps/files_sharing/api/v1/remote_shares',
- array('\OCA\Files_Sharing\API\Remote', 'getShares'),
- 'files_sharing');
-
-API::register('get',
- '/apps/files_sharing/api/v1/remote_shares/pending',
- array('\OCA\Files_Sharing\API\Remote', 'getOpenShares'),
- 'files_sharing');
-
-API::register('post',
- '/apps/files_sharing/api/v1/remote_shares/pending/{id}',
- array('\OCA\Files_Sharing\API\Remote', 'acceptShare'),
- 'files_sharing');
-
-API::register('delete',
- '/apps/files_sharing/api/v1/remote_shares/pending/{id}',
- array('\OCA\Files_Sharing\API\Remote', 'declineShare'),
- 'files_sharing');
-
-API::register('get',
- '/apps/files_sharing/api/v1/remote_shares/{id}',
- array('\OCA\Files_Sharing\API\Remote', 'getShare'),
- 'files_sharing');
-
-API::register('delete',
- '/apps/files_sharing/api/v1/remote_shares/{id}',
- array('\OCA\Files_Sharing\API\Remote', 'unshare'),
- 'files_sharing');
-
-
-$sharees = new \OCA\Files_Sharing\API\Sharees(\OC::$server->getGroupManager(),
- \OC::$server->getUserManager(),
- \OC::$server->getContactsManager(),
- \OC::$server->getConfig(),
- \OC::$server->getUserSession(),
- \OC::$server->getURLGenerator(),
- \OC::$server->getRequest(),
- \OC::$server->getLogger(),
- \OC::$server->getShareManager());
-
-API::register('get',
- '/apps/files_sharing/api/v1/sharees',
- [$sharees, 'search'],
- 'files_sharing', API::USER_AUTH);
-
+ 'ocs' => [
+ /*
+ * OCS Share API
+ */
+ [
+ 'name' => 'ShareAPI#getShares',
+ 'url' => '/api/v1/shares',
+ 'verb' => 'GET',
+ ],
+ [
+ 'name' => 'ShareAPI#getInheritedShares',
+ 'url' => '/api/v1/shares/inherited',
+ 'verb' => 'GET',
+ ],
+ [
+ 'name' => 'ShareAPI#createShare',
+ 'url' => '/api/v1/shares',
+ 'verb' => 'POST',
+ ],
+ [
+ 'name' => 'ShareAPI#pendingShares',
+ 'url' => '/api/v1/shares/pending',
+ 'verb' => 'GET',
+ ],
+ [
+ 'name' => 'ShareAPI#getShare',
+ 'url' => '/api/v1/shares/{id}',
+ 'verb' => 'GET',
+ ],
+ [
+ 'name' => 'ShareAPI#updateShare',
+ 'url' => '/api/v1/shares/{id}',
+ 'verb' => 'PUT',
+ ],
+ [
+ 'name' => 'ShareAPI#deleteShare',
+ 'url' => '/api/v1/shares/{id}',
+ 'verb' => 'DELETE',
+ ],
+ [
+ 'name' => 'ShareAPI#sendShareEmail',
+ 'url' => '/api/v1/shares/{id}/send-email',
+ 'verb' => 'POST',
+ ],
+ [
+ 'name' => 'ShareAPI#acceptShare',
+ 'url' => '/api/v1/shares/pending/{id}',
+ 'verb' => 'POST',
+ ],
+ /*
+ * Deleted Shares
+ */
+ [
+ 'name' => 'DeletedShareAPI#index',
+ 'url' => '/api/v1/deletedshares',
+ 'verb' => 'GET',
+ ],
+ [
+ 'name' => 'DeletedShareAPI#undelete',
+ 'url' => '/api/v1/deletedshares/{id}',
+ 'verb' => 'POST',
+ ],
+ /*
+ * OCS Sharee API
+ */
+ [
+ 'name' => 'ShareesAPI#search',
+ 'url' => '/api/v1/sharees',
+ 'verb' => 'GET',
+ ],
+ [
+ 'name' => 'ShareesAPI#findRecommended',
+ 'url' => '/api/v1/sharees_recommended',
+ 'verb' => 'GET',
+ ],
+ /*
+ * Remote Shares
+ */
+ [
+ 'name' => 'Remote#getShares',
+ 'url' => '/api/v1/remote_shares',
+ 'verb' => 'GET',
+ ],
+ [
+ 'name' => 'Remote#getOpenShares',
+ 'url' => '/api/v1/remote_shares/pending',
+ 'verb' => 'GET',
+ ],
+ [
+ 'name' => 'Remote#acceptShare',
+ 'url' => '/api/v1/remote_shares/pending/{id}',
+ 'verb' => 'POST',
+ ],
+ [
+ 'name' => 'Remote#declineShare',
+ 'url' => '/api/v1/remote_shares/pending/{id}',
+ 'verb' => 'DELETE',
+ ],
+ [
+ 'name' => 'Remote#getShare',
+ 'url' => '/api/v1/remote_shares/{id}',
+ 'verb' => 'GET',
+ ],
+ [
+ 'name' => 'Remote#unshare',
+ 'url' => '/api/v1/remote_shares/{id}',
+ 'verb' => 'DELETE',
+ ],
+ ],
+];
diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php
deleted file mode 100644
index adfff183b3f..00000000000
--- a/apps/files_sharing/appinfo/update.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**
- * @author Björn Schießle <schiessle@owncloud.com>
- * @author Joas Schilling <nickvergessen@owncloud.com>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Roeland Jago Douma <rullzer@owncloud.com>
- *
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-use OCA\Files_Sharing\Migration;
-
-$installedVersion = \OC::$server->getConfig()->getAppValue('files_sharing', 'installed_version');
-
-// Migration OC8.2 -> OC9
-if (version_compare($installedVersion, '0.9.1', '<')) {
- $m = new Migration(\OC::$server->getDatabaseConnection());
- $m->removeReShares();
- $m->updateInitiatorInfo();
-}
-
-\OC::$server->getJobList()->add('OCA\Files_sharing\Lib\DeleteOrphanedSharesJob');
-\OC::$server->getJobList()->add('OCA\Files_sharing\ExpireSharesJob');