24993280ed
Beside some small improvements and bug fixes this will probably the final state for OC8. To test this you need to set up two ownCloud instances. Let's say: URL: myPC/firstOwnCloud user: user1 URL: myPC/secondOwnCloud user: user2 Now user1 can share a file with user2 by entering the username and the URL to the second ownCloud to the share-drop-down, in this case "user2@myPC/secondOwnCloud". The next time user2 login he will get a notification that he received a server-to-server share with the option to accept/decline it. If he accept it the share will be mounted. In both cases a event will be send back to user1 and add a notification to the activity stream that the share was accepted/declined. If user1 decides to unshare the file again from user2 the share will automatically be removed from the second ownCloud server and user2 will see a notification in his activity stream that user1@myPC/firstOwnCloud has unshared the file/folder from him.
58 lines
1.8 KiB
PHP
58 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace OCA\Files_Sharing\AppInfo;
|
|
|
|
use OCA\Files_Sharing\Application;
|
|
|
|
$application = new Application();
|
|
$application->registerRoutes($this, [
|
|
'resources' => [
|
|
'ExternalShares' => ['url' => '/api/externalShares'],
|
|
]
|
|
]);
|
|
|
|
/** @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');
|
|
$this->create('sharing_external_test_remote', '/testremote')
|
|
->actionInclude('files_sharing/ajax/testremote.php');
|
|
|
|
// OCS API
|
|
|
|
//TODO: SET: mail notification, waiting for PR #4689 to be accepted
|
|
|
|
\OC_API::register('get',
|
|
'/apps/files_sharing/api/v1/shares',
|
|
array('\OCA\Files_Sharing\API\Local', 'getAllShares'),
|
|
'files_sharing');
|
|
|
|
\OC_API::register('post',
|
|
'/apps/files_sharing/api/v1/shares',
|
|
array('\OCA\Files_Sharing\API\Local', 'createShare'),
|
|
'files_sharing');
|
|
|
|
\OC_API::register('get',
|
|
'/apps/files_sharing/api/v1/shares/{id}',
|
|
array('\OCA\Files_Sharing\API\Local', 'getShare'),
|
|
'files_sharing');
|
|
|
|
\OC_API::register('put',
|
|
'/apps/files_sharing/api/v1/shares/{id}',
|
|
array('\OCA\Files_Sharing\API\Local', 'updateShare'),
|
|
'files_sharing');
|
|
|
|
\OC_API::register('delete',
|
|
'/apps/files_sharing/api/v1/shares/{id}',
|
|
array('\OCA\Files_Sharing\API\Local', 'deleteShare'),
|
|
'files_sharing');
|