From 47517c76094834d582121b84098c84c0bcb8353f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 23 Apr 2015 17:40:24 +0200 Subject: Add AddUser mask for creating test accounts --- inc/user.inc.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'inc') diff --git a/inc/user.inc.php b/inc/user.inc.php index e2b7e43..3325421 100644 --- a/inc/user.inc.php +++ b/inc/user.inc.php @@ -76,6 +76,16 @@ class User { return isset(self::$user['role']) && self::$user['role'] === 'tutor'; } + + public static function isAdmin() + { + // TODO: Not hardcoded; per Institution... + return in_array(self::getShibId(), array( + '5fb22037697816a70a847d15245c9f88', + '94e48d34587ab9963a2013ddc97e1e45', + 'fb91f270a95a5b006be916f2b2da305c', + ), true); + } public static function getOrganizationId() { @@ -111,6 +121,13 @@ class User } return self::$organization; } + + public static function getShibId() + { + if (empty(self::$user['shibid'])) + return false; + return self::$user['shibid']; + } public static function load() { -- cgit v1.2.3-55-g7522