aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/entities.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-18 09:33:22 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-18 09:33:22 +0000
commit14eeaf39e11b5056f3346042949358cf2d198583 (patch)
treeaeec6e518564460417fa469f3a18b29ed3d3e3fd /engine/lib/entities.php
parent8a5ee076589070ff1654fd6afdf7b347beca5890 (diff)
downloadelgg-14eeaf39e11b5056f3346042949358cf2d198583.tar.gz
elgg-14eeaf39e11b5056f3346042949358cf2d198583.tar.bz2
Removing a user disables their entities
git-svn-id: https://code.elgg.org/elgg/trunk@1997 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r--engine/lib/entities.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index a2026d982..0f9f24c81 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1495,6 +1495,26 @@
}
}
return false;
+ }
+
+ /**
+ * Disables all of a user's entities
+ *
+ * @param int $owner_guid The owner GUID
+ * @return true|false Depending on success
+ */
+ function disable_entities($owner_guid) {
+
+ global $CONFIG;
+ $owner_guid = (int) $owner_guid;
+ if ($entity = get_entity($owner_guid)) {
+ if ($entity->canEdit()) {
+ $res = update_data("UPDATE {$CONFIG->dbprefix}entities set enabled='no' where owner_guid={$owner_guid} or container_guid = {$owner_guid}");
+ return $res;
+ }
+ }
+ return false;
+
}
/**