Skip to content

Commit

Permalink
Always include Anonymous User Name
Browse files Browse the repository at this point in the history
It is also now Language  aware.
  • Loading branch information
eSilverStrike committed Apr 21, 2020
1 parent 81bc57c commit 571c7fb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions system/lib-sessions.php
Expand Up @@ -75,14 +75,15 @@
*/
function SESS_sessionCheck()
{
global $_CONF, $_TABLES, $_USER, $_SESS_VERBOSE;
global $_CONF, $_TABLES, $_USER, $_SESS_VERBOSE, $LANG01;

if ($_SESS_VERBOSE) {
COM_errorLog("*** Inside SESS_sessionCheck ***",1);
}

$_USER = array(
'uid' => Session::ANON_USER_ID,
'username' => $LANG01[24] // Anonymous
);

// Check for a cookie on the users's machine. If the cookie exists, build
Expand Down Expand Up @@ -418,13 +419,13 @@ function SESS_deleteUserSessions($userId)
*/
function SESS_getUserDataFromId($userId)
{
global $_TABLES, $_USER;
global $_TABLES, $_USER, $LANG01;

$userId = (int) $userId;
if ($userId <= Session::ANON_USER_ID) {
return array(
'uid' => Session::ANON_USER_ID,
'username' => 'anonymous',
'username' => $LANG01[24] // Anonymous
);
}

Expand All @@ -435,7 +436,7 @@ function SESS_getUserDataFromId($userId)
if ((!$result = DB_query($sql)) || (!$myRow = DB_fetchArray($result, false))) {
return array(
'uid' => $userId,
'username' => 'anonymous',
'username' => $LANG01[24], // Anonymous
'error' => '1',
);
}
Expand Down

0 comments on commit 571c7fb

Please sign in to comment.