From 3c181054dbe60467cc744c447010f525a862c26e Mon Sep 17 00:00:00 2001 From: mensonge Date: Fri, 21 Nov 2008 10:44:28 +0000 Subject: 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 --- services/userservice.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'services') 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; } -- cgit v1.2.3