Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2020-06-11 15:55:55 +0300
committerdartcafe <github@dartcafe.de>2020-07-07 18:39:48 +0300
commit93ef72a14a9f6386effe34304882f3b015eecbb0 (patch)
tree51ee81d0d963513eda653cec1452e1ee82c54ea0 /lib
parent5d63be91b2cbb87cb4dc871d449b06b920e1649e (diff)
avoid fetching foto fix #912
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/SystemController.php22
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/Controller/SystemController.php b/lib/Controller/SystemController.php
index 86051bfb..894a7893 100644
--- a/lib/Controller/SystemController.php
+++ b/lib/Controller/SystemController.php
@@ -94,6 +94,7 @@ class SystemController extends Controller {
/**
* Get a list of NC users, groups and contacts
* @NoAdminRequired
+ * @PublicPage
* @NoCSRFRequired
* @param string $query
* @param bool $getGroups - search in groups
@@ -105,7 +106,7 @@ class SystemController extends Controller {
*/
public function getSiteUsersAndGroups($query = '', $getGroups = true, $getUsers = true, $getContacts = true, $getMail = false, $skipGroups = array(), $skipUsers = array()) {
$list = array();
- // if (filter_var($query, FILTER_VALIDATE_EMAIL)) {
+
if ($this->isValidEmail($query)) {
$list[] = [
'id' => '',
@@ -124,10 +125,8 @@ class SystemController extends Controller {
];
}
-
if ($getGroups) {
- $groups = $this->groupManager->search($query);
- foreach ($groups as $group) {
+ foreach ($this->groupManager->search($query) as $group) {
if (!in_array($group->getGID(), $skipGroups)) {
$list[] = [
'id' => $group->getGID(),
@@ -149,8 +148,7 @@ class SystemController extends Controller {
}
if ($getUsers) {
- $users = $this->userManager->searchDisplayName($query);
- foreach ($users as $user) {
+ foreach ($this->userManager->searchDisplayName($query) as $user) {
if (!in_array($user->getUID(), $skipUsers)) {
$list[] = [
'id' => $user->getUID(),
@@ -170,13 +168,9 @@ class SystemController extends Controller {
}
}
- $contactsManager = \OC::$server->getContactsManager();
-
-
- if ($getContacts && $contactsManager->isEnabled()) {
- $contacts = $contactsManager->search($query, array('FN', 'EMAIL', 'ORG', 'CATEGORIES'));
+ if ($getContacts && \OC::$server->getContactsManager()->isEnabled()) {
- foreach ($contacts as $contact) {
+ foreach (\OC::$server->getContactsManager()->search($query, array('FN', 'EMAIL', 'ORG', 'CATEGORIES')) as $contact) {
if (!array_key_exists('isLocalSystemBook', $contact) && array_key_exists('EMAIL', $contact)) {
$emailAdresses = $contact['EMAIL'];
@@ -199,9 +193,9 @@ class SystemController extends Controller {
'type' => 'contact',
'icon' => 'icon-mail',
'avatarURL' => '',
- 'avatar' => isset($contact['PHOTO']) ? $contact['PHOTO'] : '',
+ 'avatar' => '',
'lastLogin' => '',
- 'cloudId' => ''
+ 'cloudId' => '',
];
}