From c0a40dd798f5604e60eb1c4b6e9a618d312fd993 Mon Sep 17 00:00:00 2001 From: icewing Date: Wed, 11 Jun 2008 12:22:44 +0000 Subject: Marcus Povey * actions with admin only support git-svn-id: https://code.elgg.org/elgg/trunk@865 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/sessions.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php index 3e1ae3c13..66758084b 100644 --- a/engine/lib/sessions.php +++ b/engine/lib/sessions.php @@ -25,6 +25,21 @@ return false; } + + /** + * Returns whether or not the user is currently logged in and that they are an admin user. + * + * @uses $_SESSION + * @uses isloggedin() + * @return true|false + */ + function isadminloggedin() + { + if ((isloggedin()) && (($_SESSION['user']->admin || $_SESSION['user']->siteadmin))) + return true; + + return false; + } /** * Perform standard authentication with a given username and password. -- cgit v1.2.3