applicable.php 545 B

123456789101112131415161718192021222324252627
  1. <?php
  2. OCP\JSON::checkAppEnabled('files_external');
  3. OCP\JSON::callCheck();
  4. OCP\JSON::checkAdminUser();
  5. $pattern = '';
  6. $limit = null;
  7. $offset = null;
  8. if (isset($_GET['pattern'])) {
  9. $pattern = $_GET['pattern'];
  10. }
  11. if (isset($_GET['limit'])) {
  12. $limit = $_GET['limit'];
  13. }
  14. if (isset($_GET['offset'])) {
  15. $offset = $_GET['offset'];
  16. }
  17. $groups = \OC_Group::getGroups($pattern, $limit, $offset);
  18. $users = \OCP\User::getDisplayNames($pattern, $limit, $offset);
  19. $results = array('groups' => $groups, 'users' => $users);
  20. \OCP\JSON::success($results);