[geeklog-cvs] geeklog-1.3/system lib-sessions.php,1.28,1.29
blaine at iowaoutdoors.org
blaine at iowaoutdoors.org
Sun Aug 8 13:00:15 EDT 2004
Update of /var/cvs/geeklog-1.3/system
In directory www:/tmp/cvs-serv12605/system
Modified Files:
lib-sessions.php
Log Message:
Added support for PHP SESSIONS - using the PEAR class HTTP_Session.
Index: lib-sessions.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/system/lib-sessions.php,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** lib-sessions.php 14 Feb 2004 13:04:10 -0000 1.28
--- lib-sessions.php 8 Aug 2004 17:00:13 -0000 1.29
***************
*** 236,240 ****
$md5_sessid = md5($ip + $sessid);
} else {
! $md5_sessid = '';
}
--- 236,240 ----
$md5_sessid = md5($ip + $sessid);
} else {
! $md5_sessid = '';
}
***************
*** 247,256 ****
$deleteSQL = "DELETE FROM {$_TABLES['sessions']} WHERE (start_time < $expirytime)";
$delresult = DB_query($deleteSQL);
!
if ($_SESS_VERBOSE) {
COM_errorLog("Attempted to delete rows from session table with following SQL\n$deleteSQL\n",1);
COM_errorLog("Got $delresult as a result from the query",1);
}
!
if (!$delresult) {
die("Delete failed in new_session()");
--- 247,256 ----
$deleteSQL = "DELETE FROM {$_TABLES['sessions']} WHERE (start_time < $expirytime)";
$delresult = DB_query($deleteSQL);
!
if ($_SESS_VERBOSE) {
COM_errorLog("Attempted to delete rows from session table with following SQL\n$deleteSQL\n",1);
COM_errorLog("Got $delresult as a result from the query",1);
}
!
if (!$delresult) {
die("Delete failed in new_session()");
***************
*** 269,277 ****
if ($result) {
if ($_CONF['lastlogin'] == true) {
! // Update userinfo record to record the date and time as lastlogin
DB_query("UPDATE {$_TABLES['userinfo']} SET lastlogin = UNIX_TIMESTAMP() WHERE uid=$userid");
! }
! if ($_SESS_VERBOSE) COM_errorLog("Assigned the following session id: $sessid",1);
! if ($_SESS_VERBOSE) COM_errorLog("*************leaving SESS_newSession*****************",1);
if ($md5_based == 1) {
return $md5_sessid;
--- 269,277 ----
if ($result) {
if ($_CONF['lastlogin'] == true) {
! // Update userinfo record to record the date and time as lastlogin
DB_query("UPDATE {$_TABLES['userinfo']} SET lastlogin = UNIX_TIMESTAMP() WHERE uid=$userid");
! }
! if ($_SESS_VERBOSE) COM_errorLog("Assigned the following session id: $sessid",1);
! if ($_SESS_VERBOSE) COM_errorLog("*************leaving SESS_newSession*****************",1);
if ($md5_based == 1) {
return $md5_sessid;
***************
*** 386,390 ****
$newtime = (string) time();
!
if ($md5_based == 1) {
$sql = "UPDATE {$_TABLES['sessions']} SET start_time=$newtime WHERE (md5_sess_id = '$sessid')";
--- 386,390 ----
$newtime = (string) time();
!
if ($md5_based == 1) {
$sql = "UPDATE {$_TABLES['sessions']} SET start_time=$newtime WHERE (md5_sess_id = '$sessid')";
***************
*** 411,418 ****
global $_TABLES;
! $sql = "DELETE FROM {$_TABLES['sessions']} WHERE (uid = $userid)";
! $result = DB_query($sql);
!
! return 1;
}
--- 411,421 ----
global $_TABLES;
! $sql = "DELETE FROM {$_TABLES['sessions']} WHERE (uid = $userid)";
! $result = DB_query($sql);
!
! // Release PHP SESSION
! HTTP_Session::destroy();
!
! return 1;
}
***************
*** 437,445 ****
COM_errorLog("error in get_userdata");
}
!
if(!$myrow = DB_fetchArray($result)) {
COM_errorLog("error in get_userdata");
}
!
return($myrow);
}
--- 440,448 ----
COM_errorLog("error in get_userdata");
}
!
if(!$myrow = DB_fetchArray($result)) {
COM_errorLog("error in get_userdata");
}
!
return($myrow);
}
***************
*** 466,470 ****
return ($userdata);
}
!
if(!$myrow = DB_fetchArray($result)) {
$userdata = array("error" => "1");
--- 469,473 ----
return ($userdata);
}
!
if(!$myrow = DB_fetchArray($result)) {
$userdata = array("error" => "1");
More information about the geeklog-cvs
mailing list