From 24993280edcf66f9daa5a5e82428fefef4a3ab56 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 4 Dec 2014 19:51:04 +0100 Subject: Next step in server-to-server sharing next generation, see #12285 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. --- core/ajax/share.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'core/ajax') diff --git a/core/ajax/share.php b/core/ajax/share.php index 9f758b4e44e..2831d42a367 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -36,7 +36,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo $shareWith = null; } $itemSourceName=(isset($_POST['itemSourceName'])) ? $_POST['itemSourceName']:''; - + $token = OCP\Share::shareItem( $_POST['itemType'], $_POST['itemSource'], @@ -309,6 +309,21 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo break; } } + + // allow user to add unknown remote addresses for server-to-server share + $backend = \OCP\Share::getBackend($_GET['itemType']); + if ($backend->isShareTypeAllowed(\OCP\Share::SHARE_TYPE_REMOTE)) { + if (substr_count($_GET['search'], '@') === 1) { + $shareWith[] = array( + 'label' => $_GET['search'], + 'value' => array( + 'shareType' => \OCP\Share::SHARE_TYPE_REMOTE, + 'shareWith' => $_GET['search'] + ) + ); + } + } + $sorter = new \OC\Share\SearchResultSorter($_GET['search'], 'label', new \OC\Log()); -- cgit v1.2.3