aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/entities.php
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-11 17:11:56 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-11 17:11:56 +0000
commit11f2942c65c038eda3fb65c40877d1081c0637e8 (patch)
tree64893c9630e2b49b7adf42d37074b29e47b2764e /engine/lib/entities.php
parentd608c770c56ec35092221b296a83dd617d58dae6 (diff)
downloadelgg-11f2942c65c038eda3fb65c40877d1081c0637e8.tar.gz
elgg-11f2942c65c038eda3fb65c40877d1081c0637e8.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Basic site admin git-svn-id: https://code.elgg.org/elgg/trunk@871 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r--engine/lib/entities.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index f96a0a6f3..7735b651b 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -881,6 +881,7 @@
$entity = get_entity($guid);
if ($entity->canEdit()) {
+
if (trigger_elgg_event('update',$entity->type,$entity)) {
$ret = update_data("UPDATE {$CONFIG->dbprefix}entities set owner_guid='$owner_guid', access_id='$access_id', time_updated='$time' WHERE guid=$guid");
@@ -1225,7 +1226,7 @@
* @return true|false Whether the specified user can edit the specified entity.
*/
function can_edit_entity($entity_guid, $user_guid = 0) {
-
+ global $CONFIG;
if ($user_guid == 0) {
if (isset($_SESSION['user'])) {
@@ -1238,9 +1239,10 @@
}
if (($entity = get_entity($entity_guid)) && (!is_null($user))) {
+
if ($entity->getOwner() == $user->getGUID()) return true;
if ($entity->type == "user" && $entity->getGUID() == $user->getGUID()) return true;
-
+
return trigger_plugin_hook('permissions_check',$entity->type,array('entity' => $entity, 'user' => $user),false);
} else {