aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-11 12:22:44 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-11 12:22:44 +0000
commitc0a40dd798f5604e60eb1c4b6e9a618d312fd993 (patch)
treefb1d2f2149038521988d9dfff23402261863fda1
parent35c9ff0b6526928c7a4394495bb4c679407ea1ec (diff)
downloadelgg-c0a40dd798f5604e60eb1c4b6e9a618d312fd993.tar.gz
elgg-c0a40dd798f5604e60eb1c4b6e9a618d312fd993.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* actions with admin only support git-svn-id: https://code.elgg.org/elgg/trunk@865 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/sessions.php15
1 files changed, 15 insertions, 0 deletions
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.