aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-13 13:37:17 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-13 13:37:17 +0000
commit01dd633eee2de4bbfdba547ffc9caab8910ae7c7 (patch)
tree58e6a7c239b5a9724a3c953cb3b32302c5e0d93a
parentdd164535d2e2a2bbc1c3bf44ba332985098be9b8 (diff)
downloadelgg-01dd633eee2de4bbfdba547ffc9caab8910ae7c7.tar.gz
elgg-01dd633eee2de4bbfdba547ffc9caab8910ae7c7.tar.bz2
Actually closes #46
git-svn-id: https://code.elgg.org/elgg/trunk@1901 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/entities.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 29c347690..dfb7492b0 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1492,8 +1492,24 @@
global $CONFIG;
$guid = (int)$guid;
- return update_data("UPDATE {$CONFIG->dbprefix}entities set enabled='yes' where guid={$guid}");
+ // Override access only visible entities
+ $access_status = access_get_show_hidden_status();
+ access_show_hidden_entities(true);
+
+ if ($entity = get_entity($guid)) {
+ if (trigger_elgg_event('delete',$entity->type,$entity)) {
+ if ($entity->canEdit()) {
+
+ access_show_hidden_entities($access_status);
+
+ return update_data("UPDATE {$CONFIG->dbprefix}entities set enabled='yes' where guid={$guid}");
+ }
+ }
+ }
+
+ access_show_hidden_entities($access_status);
+ return false;
}
/**