From f9dcb559e9693e7706184f4d48f20eee096b6c7f Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 25 Jun 2015 11:57:03 +0200 Subject: search address book for federated cloud id --- core/ajax/share.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'core/ajax') diff --git a/core/ajax/share.php b/core/ajax/share.php index e78d274815d..4ce67736ab9 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -352,8 +352,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()); -- cgit v1.2.3