diff options
Diffstat (limited to 'apps/files_external/ajax/applicable.php')
-rw-r--r-- | apps/files_external/ajax/applicable.php | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/apps/files_external/ajax/applicable.php b/apps/files_external/ajax/applicable.php index 5d30dfdbb51..ece913ffc06 100644 --- a/apps/files_external/ajax/applicable.php +++ b/apps/files_external/ajax/applicable.php @@ -1,29 +1,18 @@ <?php + +use OCP\IGroupManager; +use OCP\IUserManager; +use OCP\Server; + /** - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Lukas Reschke <lukas@owncloud.com> - * @author Robin McCorkell <robin@mccorkell.me.uk> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * + * SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-only */ -OCP\JSON::checkAppEnabled('files_external'); -OCP\JSON::callCheck(); +\OC_JSON::checkAppEnabled('files_external'); +\OC_JSON::callCheck(); -OCP\JSON::checkAdminUser(); +\OC_JSON::checkAdminUser(); $pattern = ''; $limit = null; @@ -39,15 +28,15 @@ if (isset($_GET['offset'])) { } $groups = []; -foreach (\OC::$server->getGroupManager()->search($pattern, $limit, $offset) as $group) { - $groups[$group->getGID()] = $group->getGID(); +foreach (Server::get(IGroupManager::class)->search($pattern, $limit, $offset) as $group) { + $groups[$group->getGID()] = $group->getDisplayName(); } $users = []; -foreach (\OC::$server->getUserManager()->searchDisplayName($pattern, $limit, $offset) as $user) { +foreach (Server::get(IUserManager::class)->searchDisplayName($pattern, $limit, $offset) as $user) { $users[$user->getUID()] = $user->getDisplayName(); } -$results = array('groups' => $groups, 'users' => $users); +$results = ['groups' => $groups, 'users' => $users]; -\OCP\JSON::success($results); +\OC_JSON::success($results); |