summaryrefslogtreecommitdiffstats
path: root/apps/files_external/ajax/applicable.php
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-08-18 22:49:29 +0100
committerRobin McCorkell <rmccorkell@owncloud.com>2015-08-19 15:26:38 +0100
commitd577aad4ac876c1ed29f7b81199f607da581239b (patch)
tree55bca408402528a7fff2e4d5a0acb5aa7e4ee534 /apps/files_external/ajax/applicable.php
parent5fd36d017ecdbce61dcf1c67ae04c8c0be81a4bf (diff)
downloadnextcloud-server-d577aad4ac876c1ed29f7b81199f607da581239b.tar.gz
nextcloud-server-d577aad4ac876c1ed29f7b81199f607da581239b.zip
Use OCP classes as much as possible in files_external
Diffstat (limited to 'apps/files_external/ajax/applicable.php')
-rw-r--r--apps/files_external/ajax/applicable.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/files_external/ajax/applicable.php b/apps/files_external/ajax/applicable.php
index 1b93cc3a1aa..5ae91c8e182 100644
--- a/apps/files_external/ajax/applicable.php
+++ b/apps/files_external/ajax/applicable.php
@@ -37,8 +37,15 @@ if (isset($_GET['offset'])) {
$offset = (int)$_GET['offset'];
}
-$groups = \OC_Group::getGroups($pattern, $limit, $offset);
-$users = \OCP\User::getDisplayNames($pattern, $limit, $offset);
+$groups = [];
+foreach (\OC::$server->getGroupManager()->search($pattern, $limit, $offset) as $group) {
+ $groups[$group->getGID()] = $group->getGID();
+}
+
+$users = [];
+foreach (\OC::$server->getUserManager()->searchDisplayName($pattern, $limit, $offset) as $user) {
+ $users[$user->getUID()] = $user->getDisplayName();
+}
$results = array('groups' => $groups, 'users' => $users);