mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 18:50:47 -04:00
This enforces proper types on POST and GET arguments where I considered it sensible. I didn't update some as I don't know what kind of values they would support 🙈 Fixes https://github.com/owncloud/core/issues/14196 for core
26 lines
563 B
PHP
26 lines
563 B
PHP
<?php
|
|
|
|
OCP\JSON::checkAppEnabled('files_external');
|
|
OCP\JSON::callCheck();
|
|
|
|
OCP\JSON::checkAdminUser();
|
|
|
|
$pattern = '';
|
|
$limit = null;
|
|
$offset = null;
|
|
if (isset($_GET['pattern'])) {
|
|
$pattern = (string)$_GET['pattern'];
|
|
}
|
|
if (isset($_GET['limit'])) {
|
|
$limit = (int)$_GET['limit'];
|
|
}
|
|
if (isset($_GET['offset'])) {
|
|
$offset = (int)$_GET['offset'];
|
|
}
|
|
|
|
$groups = \OC_Group::getGroups($pattern, $limit, $offset);
|
|
$users = \OCP\User::getDisplayNames($pattern, $limit, $offset);
|
|
|
|
$results = array('groups' => $groups, 'users' => $users);
|
|
|
|
\OCP\JSON::success($results);
|