aboutsummaryrefslogtreecommitdiff
path: root/actions/subgroups/remove.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-16 21:01:42 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-16 21:01:42 -0300
commit5f6dc365a8445a48156b45912827eac39fd64fc5 (patch)
tree0dc3326151072bb5d97592513e1af4b40be32e07 /actions/subgroups/remove.php
downloadelgg-5f6dc365a8445a48156b45912827eac39fd64fc5.tar.gz
elgg-5f6dc365a8445a48156b45912827eac39fd64fc5.tar.bz2
Squashed 'mod/subgroups/' content from commit 835015b
git-subtree-dir: mod/subgroups git-subtree-split: 835015b66b9de6dc6de91ab39f95e1f09b2dbf84
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);