aboutsummaryrefslogtreecommitdiff
path: root/deactivate.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 /deactivate.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 'deactivate.php')
-rw-r--r--deactivate.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/deactivate.php b/deactivate.php
new file mode 100644
index 000000000..9b0cd1189
--- /dev/null
+++ b/deactivate.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Resets container guids from all groups that aren't subgroups to owner guid
+ */
+
+$groups = elgg_get_entities(array(
+ 'type' => 'group',
+ 'limit' => 0,
+));
+
+foreach($groups as $group) {
+ global $CONFIG;
+ if (!elgg_instanceof($group->getContainerEntity(), 'group')) {
+ $query = "UPDATE {$CONFIG->dbprefix}entities set"
+ . " container_guid=0 where guid={$group->owner_guid}";
+ update_data($query);
+ }
+}