search address book for federated cloud id

This commit is contained in:
Bjoern Schiessle 2015-06-25 11:57:03 +02:00
parent 7a3cfbc3c8
commit f9dcb559e9
1 changed files with 16 additions and 0 deletions

View File

@ -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());