summaryrefslogtreecommitdiffstats
path: root/apps/files_external/ajax/applicable.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2014-05-08 15:25:46 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2014-08-25 11:50:19 +0200
commit308e8d63793761460b9d2a50d6f815403e106d83 (patch)
tree37171ee8c0450176bd7a9c2975654130c00b72f3 /apps/files_external/ajax/applicable.php
parentbff39f796e16142346d14ce9b61512644ba6f6cc (diff)
downloadnextcloud-server-308e8d63793761460b9d2a50d6f815403e106d83.tar.gz
nextcloud-server-308e8d63793761460b9d2a50d6f815403e106d83.zip
replace chosen with select2 to provide ajaxified user and group selection for files_external, fixes #7499
remove minified select2 js show avatars for users, simpler results remove unneeded users and groups from settings template fix css, escape user and group names
Diffstat (limited to 'apps/files_external/ajax/applicable.php')
-rw-r--r--apps/files_external/ajax/applicable.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/apps/files_external/ajax/applicable.php b/apps/files_external/ajax/applicable.php
new file mode 100644
index 00000000000..1f0147758e7
--- /dev/null
+++ b/apps/files_external/ajax/applicable.php
@@ -0,0 +1,26 @@
+<?php
+
+OCP\JSON::checkAppEnabled('files_external');
+OCP\JSON::callCheck();
+
+OCP\JSON::checkAdminUser();
+
+$pattern = '';
+$limit = null;
+$offset = null;
+if (isset($_GET['pattern'])) {
+ $pattern = $_GET['pattern'];
+}
+if (isset($_GET['limit'])) {
+ $limit = $_GET['limit'];
+}
+if (isset($_GET['offset'])) {
+ $offset = $_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);