summaryrefslogtreecommitdiffstats
path: root/core/ajax
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-06-26 10:53:02 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-06-26 10:53:02 +0200
commit6c3a4282e5f24b5914b8d1afa869d9595fb14261 (patch)
treec7db4bcb8bdedae97c4377003fa011ac16c45a0b /core/ajax
parent569157d529ccd15d8eb3c77e0c283c14951bfe3a (diff)
parenta288d0eea36331703bf1d6e48b4bbe3e0b98e4b2 (diff)
downloadnextcloud-server-6c3a4282e5f24b5914b8d1afa869d9595fb14261.tar.gz
nextcloud-server-6c3a4282e5f24b5914b8d1afa869d9595fb14261.zip
Merge pull request #17165 from owncloud/federated_cloud_sharing_search_address_book
Search address book for federated cloud id
Diffstat (limited to 'core/ajax')
-rw-r--r--core/ajax/share.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php
index f84325dc17e..22f483ec0e1 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -359,8 +359,24 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
)
);
}
+ $contactManager = \OC::$server->getContactsManager();
+ $addressBookContacts = $contactManager->search($_GET['search'], ['CLOUD', 'FN']);
+ foreach ($addressBookContacts as $contact) {
+ if (isset($contact['CLOUD'])) {
+ foreach ($contact['CLOUD'] as $cloudId) {
+ $shareWith[] = array(
+ 'label' => $contact['FN'] . ' (' . $cloudId . ')',
+ 'value' => array(
+ 'shareType' => \OCP\Share::SHARE_TYPE_REMOTE,
+ 'shareWith' => $cloudId
+ )
+ );
+ }
+ }
+ }
}
+
$sorter = new \OC\Share\SearchResultSorter((string)$_GET['search'],
'label',
\OC::$server->getLogger());