aboutsummaryrefslogtreecommitdiff
path: root/actions/subgroups/remove.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/subgroups/remove.php')
-rw-r--r--actions/subgroups/remove.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/actions/subgroups/remove.php b/actions/subgroups/remove.php
new file mode 100644
index 000000000..206673de3
--- /dev/null
+++ b/actions/subgroups/remove.php
@@ -0,0 +1,13 @@
+<?php
+
+$group_guid = get_input('group');
+$othergroup_guid = get_input('othergroup');
+$group = get_entity($group_guid);
+$othergroup = get_entity($othergroup_guid);
+if ($group instanceof ElggGroup && $group->canEdit()) {
+ if ($othergroup instanceof ElggGroup && $othergroup->canEdit() && $othergroup->container_guid == $group_guid) {
+ $othergroup->container_guid = $other_group->owner_guid;
+ $othergroup->save();
+ }
+}
+forward(REFERER);