aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/sessions.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php
index cb7f8c2ba..3e1ae3c13 100644
--- a/engine/lib/sessions.php
+++ b/engine/lib/sessions.php
@@ -186,6 +186,16 @@
*/
function gatekeeper() {
if (!isloggedin()) forward();
+ }
+
+ /**
+ * Used at the top of a page to mark it as logged in admin or siteadmin only.
+ *
+ */
+ function admin_gatekeeper()
+ {
+ gatekeeper();
+ if (!$_SESSION['user']->admin && !$_SESSION['user']->siteadmin) forward();
}
register_elgg_event_handler("boot","system","session_init",1);