From e58f84ce5943e743d34ddc3c990d983dccb17d15 Mon Sep 17 00:00:00 2001 From: mensonge Date: Fri, 11 Apr 2008 06:52:25 +0000 Subject: [PATCH] New feature: add admins profile [Config modified: ] git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@102 b3834d28-1941-0410-a4f8-b48e95affb8f --- config.inc.php.example | 3 +++ services/userservice.php | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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() {