aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/admin.php')
-rw-r--r--engine/lib/admin.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index c598295be..1ba971347 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -111,13 +111,12 @@ function admin_settings_page_handler($page) {
* @return true|null True if the current user is an admin.
*/
function admin_permissions($hook, $type, $returnval, $params) {
- if (is_array($params) && !empty($params['user']) && $params['user'] instanceof ElggUser) {
-
- $admin = $params['user']->admin;
- if ($admin) {
- return true;
- }
+ if (elgg_check_access_overrides()) {
+ return true;
}
+
+ // consult other hooks
+ return NULL;
}
/**
@@ -164,9 +163,9 @@ function clear_admin_message($guid) {
}
/// Register init functions
-register_elgg_event_handler('init','system','admin_init');
-register_elgg_event_handler('pagesetup','system','admin_pagesetup');
+register_elgg_event_handler('init', 'system', 'admin_init');
+register_elgg_event_handler('pagesetup', 'system', 'admin_pagesetup');
// Register a plugin hook for permissions
-register_plugin_hook('permissions_check','all','admin_permissions');
-register_plugin_hook('container_permissions_check','all','admin_permissions'); \ No newline at end of file
+register_plugin_hook('permissions_check', 'all', 'admin_permissions');
+register_plugin_hook('container_permissions_check', 'all', 'admin_permissions'); \ No newline at end of file