summaryrefslogtreecommitdiff
path: root/services/userservice.php
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-21 10:44:28 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-21 10:44:28 +0000
commit3c181054dbe60467cc744c447010f525a862c26e (patch)
treecaf19eca71e1339768620b8b2936c12f36dbdac7 /services/userservice.php
parent8ca4455dc7add53f496161eda1e86c455d4ce37c (diff)
downloadsemanticscuttle-3c181054dbe60467cc744c447010f525a862c26e.tar.gz
semanticscuttle-3c181054dbe60467cc744c447010f525a862c26e.tar.bz2
Refactoring: improve debug_mode, constants and other stuff
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@168 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'services/userservice.php')
-rw-r--r--services/userservice.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/services/userservice.php b/services/userservice.php
index 9b295da..e611cb8 100644
--- a/services/userservice.php
+++ b/services/userservice.php
@@ -23,8 +23,8 @@ class UserService {
function UserService(& $db) {
$this->db =& $db;
$this->tablename = $GLOBALS['tableprefix'] .'users';
- $this->sessionkey = $GLOBALS['cookieprefix'].INSTALLATION_ID.'-currentuserid';
- $this->cookiekey = $GLOBALS['cookieprefix'].INSTALLATION_ID.'-login';
+ $this->sessionkey = INSTALLATION_ID.'-currentuserid';
+ $this->cookiekey = INSTALLATION_ID.'-login';
$this->profileurl = createURL('profile', '%2$s');
}
@@ -124,10 +124,11 @@ class UserService {
if (!is_null($newval)) //internal use only: reset currentuser
$currentuser = $newval;
else if ($refresh || !isset($currentuser)) {
- if ($id = $this->getCurrentUserId())
- $currentuser = $this->getUser($id);
- else
- return null;
+ if ($id = $this->getCurrentUserId()) {
+ $currentuser = $this->getUser($id);
+ } else {
+ $currentuser = null;
+ }
}
return $currentuser;
}