lines 1755-1790
// -----------------------------------------------------------------
// We are automatically adding StyleSheet, Status, Privates and
// FrontPage and Number to each SQL call because this information is needed by
// every script that makes a call to authenticate
else {
if ($Query) { $Query .=","; }
$Query .= "U_Username,U_Password,U_SessionId, U_StyleSheet, U_Status, U_Privates, U_FrontPage, U_Number, U_PrivatePopup, U_PrivateAlert";
}
$Uid = addslashes(${$config['cookieprefix']."w3t_myid"});
$query = "SELECT $Query FROM {$config['tbprefix']}Users WHERE U_Number = '$Uid'";
$sth = $dbh -> do_query($query);
$thisuser = $dbh -> fetch_array($sth);
$dbh -> finish_sth($query);
if ( ($thisuser['U_SessionId']) && ($thisuser['U_SessionId'] == ${$config['cookieprefix']."w3t_mysess"}) ) {
return $thisuser;
} elseif (${$config['cookieprefix']."w3t_key"} == md5("{$thisuser['U_Number']}{$thisuser['U_Password']}")) {
srand((double)microtime()*1000000);
$newsessionid = md5(rand(0,32767));
$newsessionid_q = addslashes($newsessionid);
$query = "
UPDATE {$config['tbprefix']}Users
SET U_SessionId = '$newsessionid_q'
WHERE U_Number = $Uid
";
$dbh -> do_query($query);
if ($config['tracking'] == "sessions") {
session_register("{$config['cookieprefix']}w3t_mysess");
${$config['cookieprefix']."w3t_mysess"} = $newsessionid;
}
else {
setcookie("{$config['cookieprefix']}w3t_mysess","$newsessionid","0","{$config['cookiepath']}");
}
return $thisuser;
}
Thanks Josh-
Last edited by JoshPet; 02/02/2003 2:44 PM.