aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-11 11:00:03 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-11 11:00:03 +0000
commit5ef70cb10787266245561b016f337ba7798035ac (patch)
treee20a8243c3d1f09883e8789d4248e605d7400237
parent9e2d0bf7e72563f4cbf2ce1c9bf453646c4a8ad4 (diff)
downloadelgg-5ef70cb10787266245561b016f337ba7798035ac.tar.gz
elgg-5ef70cb10787266245561b016f337ba7798035ac.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Introducing admin_gatekeeper() git-svn-id: https://code.elgg.org/elgg/trunk@861 36083f99-b078-4883-b0ff-0f9b5a30f544
-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);