aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/admin.php4
-rw-r--r--engine/lib/entities.php6
-rw-r--r--engine/lib/sites.php2
3 files changed, 9 insertions, 3 deletions
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index 2434ab62c..e9b3e6684 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -45,6 +45,10 @@
extend_elgg_admin_page('admin/main_opt/site', 'admin/main');
extend_elgg_admin_page('admin/main_opt/user', 'admin/main');
extend_elgg_admin_page('admin/main_opt/plugins', 'admin/main', 999); // Always last
+
+
+ // Register some actions
+ register_action('admin/site/update_basic', false, "", true); // Register basic site admin action
}
/// Register init function
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 {
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index 5f496a58d..4d3de2794 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -142,7 +142,7 @@
// Save generic stuff
if (!parent::save())
return false;
-
+
// Now save specific stuff
return create_site_entity($this->get('guid'), $this->get('name'), $this->get('description'), $this->get('url'));
}