diff options
-rw-r--r-- | config.inc.php.example | 3 | ||||
-rw-r--r-- | services/userservice.php | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/config.inc.php.example b/config.inc.php.example index 23a2ad8..dad6155 100644 --- a/config.inc.php.example +++ b/config.inc.php.example @@ -33,6 +33,9 @@ $sitename = 'SemanticScuttle'; $welcomeMessage = 'More than tags...'; # locale: The locale used (list ./locales : de_DE en_GB fr_FR it_IT lt_LT nl_NL zh_CN dk_DK es_ES hi_IN ja_JP pt_BR) $locale = 'en_GB'; +# admin users: +# add users as admin by: $admins = array('adminnickname', 'user1nick', 'user2nick'); +$admin_users = array(); ### display templates ### # top_include: The header file. diff --git a/services/userservice.php b/services/userservice.php index 381ae51..c691b36 100644 --- a/services/userservice.php +++ b/services/userservice.php @@ -133,7 +133,14 @@ class UserService { } function isAdmin($userid) { - return false; //not implemented yet + $user = $this->getUser($userid); + + if(isset($GLOBALS['admin_users']) + && in_array($user['username'], $GLOBALS['admin_users'])) { + return true; + } else { + return false; + } } function getCurrentUserId() { |