diff options
Diffstat (limited to 'engine/lib/admin.php')
-rw-r--r-- | engine/lib/admin.php | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/engine/lib/admin.php b/engine/lib/admin.php index e9b3e6684..aa730407c 100644 --- a/engine/lib/admin.php +++ b/engine/lib/admin.php @@ -50,7 +50,27 @@ // Register some actions register_action('admin/site/update_basic', false, "", true); // Register basic site admin action } - +
+ /**
+ * Admin permissions system
+ *
+ * @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;
+ }
+ }
+
+ }
+ /// Register init function - register_elgg_event_handler('init','system','admin_init'); + register_elgg_event_handler('init','system','admin_init');
+
+ // Register a plugin hook for permissions
+ register_plugin_hook('permissions_check','all','admin_permissions');
+ ?>
\ No newline at end of file |