summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-04-11 06:52:25 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-04-11 06:52:25 +0000
commite58f84ce5943e743d34ddc3c990d983dccb17d15 (patch)
tree8dfe22f6046bd947115afa23d3ba751144baa411
parentc86caa886656c5588da416b54c1c1bf62aaf3d74 (diff)
downloadsemanticscuttle-e58f84ce5943e743d34ddc3c990d983dccb17d15.tar.gz
semanticscuttle-e58f84ce5943e743d34ddc3c990d983dccb17d15.tar.bz2
New feature: add admins profile [Config modified: ]
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@102 b3834d28-1941-0410-a4f8-b48e95affb8f
-rw-r--r--config.inc.php.example3
-rw-r--r--services/userservice.php9
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() {