From 5ef70cb10787266245561b016f337ba7798035ac Mon Sep 17 00:00:00 2001 From: icewing Date: Wed, 11 Jun 2008 11:00:03 +0000 Subject: Marcus Povey * Introducing admin_gatekeeper() git-svn-id: https://code.elgg.org/elgg/trunk@861 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/sessions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'engine/lib/sessions.php') 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); -- cgit v1.2.3