diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-07 15:14:19 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-07 15:14:19 +0000 |
commit | 110f0fa670a03bcd7f95a2d45a42d8a891d70544 (patch) | |
tree | b5bcdae6990f9692ff549f1718a60f63c877f3e5 /engine/lib/annotations.php | |
parent | 94a18aa796feef027cd33ec41ad4f955c7c991e3 (diff) | |
download | elgg-110f0fa670a03bcd7f95a2d45a42d8a891d70544.tar.gz elgg-110f0fa670a03bcd7f95a2d45a42d8a891d70544.tar.bz2 |
Further delete and event trigger fixes
git-svn-id: https://code.elgg.org/elgg/trunk@412 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/annotations.php')
-rw-r--r-- | engine/lib/annotations.php | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index f2b9e16fb..7e8caaab6 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -397,18 +397,24 @@ $guid = (int)$guid; $name = get_metastring_id($name); +
+ $entity_guid = (int)$entity_guid;
+ if ($entity = get_entity($entity_guid)) {
+ if ($entity->canEdit()) {
- $where = array(); - - if ($name != "") - $where[] = " name_id='$name'"; - - $query = "DELETE from {$CONFIG->dbprefix}annotations where entity_guid=$guid and "; - foreach ($where as $w) - $query .= " $w and "; - $query .= "(access_id in {$access} or (access_id = 0 and owner_guid = {$_SESSION['id']}))"; - - return delete_data(); + $where = array(); + + if ($name != "") + $where[] = " name_id='$name'"; + + $query = "DELETE from {$CONFIG->dbprefix}annotations where entity_guid=$guid "; + foreach ($where as $w) + $query .= " and $w"; + + return delete_data($query);
+
+ }
+ } } /** |