summaryrefslogtreecommitdiffstats
path: root/settings/ajax/excludegroups.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-05-13 15:22:18 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2014-05-22 10:43:44 +0200
commit12338e0ef07c409156fa9cd1008bb981bda20461 (patch)
treefe859814a2321ab98f498a623db39dab892b8153 /settings/ajax/excludegroups.php
parent14a953fbe01a3d26e1330ea224ab71928a2f93c1 (diff)
downloadnextcloud-server-12338e0ef07c409156fa9cd1008bb981bda20461.tar.gz
nextcloud-server-12338e0ef07c409156fa9cd1008bb981bda20461.zip
allow admin to disable sharing for specific groups of users
Diffstat (limited to 'settings/ajax/excludegroups.php')
-rw-r--r--settings/ajax/excludegroups.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/settings/ajax/excludegroups.php b/settings/ajax/excludegroups.php
new file mode 100644
index 00000000000..2934a448a6a
--- /dev/null
+++ b/settings/ajax/excludegroups.php
@@ -0,0 +1,18 @@
+<?php
+OC_JSON::checkSubAdminUser();
+OCP\JSON::callCheck();
+
+$selectedGroups = isset($_POST["selectedGroups"]) ? json_decode($_POST["selectedGroups"]) : array();
+$changedGroup = isset($_POST["changedGroup"]) ? $_POST["changedGroup"] : '';
+
+if ($changedGroup !== '') {
+ if(($key = array_search($changedGroup, $selectedGroups)) !== false) {
+ unset($selectedGroups[$key]);
+ } else {
+ $selectedGroups[] = $changedGroup;
+ }
+} else {
+ \OCP\Util::writeLog('core', 'Can not update list of excluded groups from sharing, parameter missing', \OCP\Util::WARN);
+}
+
+\OC_Appconfig::setValue('core', 'shareapi_exclude_groups_list', implode(',', $selectedGroups));