use configured lookup server

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
Bjoern Schiessle 2017-04-21 12:23:44 +02:00 committed by Morris Jobke
parent cbf5acca45
commit 866e5d6d05
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
1 changed files with 2 additions and 1 deletions

View File

@ -654,13 +654,14 @@ class ShareesAPIController extends OCSController {
protected function getLookup($search) { protected function getLookup($search) {
$isEnabled = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'no'); $isEnabled = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'no');
$lookupServerUrl = $this->config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com');
$result = []; $result = [];
if($isEnabled === 'yes') { if($isEnabled === 'yes') {
try { try {
$client = $this->clientService->newClient(); $client = $this->clientService->newClient();
$response = $client->get( $response = $client->get(
'https://lookup.nextcloud.com/users?search=' . urlencode($search), $lookupServerUrl . '/users?search=' . urlencode($search),
[ [
'timeout' => 10, 'timeout' => 10,
'connect_timeout' => 3, 'connect_timeout' => 3,