[Logicampus-cvs] logicampus/src/logicreate/lib LC_user.php, 1.36, 1.37
Brought to you by:
trilexcom
From: Mark K <har...@us...> - 2008-02-17 03:20:11
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lib In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27886 Modified Files: LC_user.php Log Message: possible fix to all login problems, no more REPLACE syntax. Index: LC_user.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/LC_user.php,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** LC_user.php 26 Jan 2008 21:21:45 -0000 1.36 --- LC_user.php 17 Feb 2008 03:20:03 -0000 1.37 *************** *** 433,444 **** $sessid = $this->_sessionKey; $val=base64_encode($val); ! $s="UPDATE lcSessions SET username =\"".$this->username."\", sessdata = \"".$val."\" WHERE sesskey = '".$sessid."'"; if ($this->username == "anonymous" ) { ! $s="UPDATE lcSessions SET sessdata = \"".$val."\" WHERE sesskey = '".$sessid."'"; } ! $queryWorked = $db->query($s); $updateWorked = $db->getAffectedRows(); if ($updateWorked < 0) { ! die('update did not work ' .$updateWorked); $e = ErrorStack::pullError('php'); --- 433,444 ---- $sessid = $this->_sessionKey; $val=base64_encode($val); ! $update="UPDATE lcSessions SET username =\"".$this->username."\", sessdata = \"".$val."\" WHERE sesskey = '".$sessid."'"; if ($this->username == "anonymous" ) { ! $update="UPDATE lcSessions SET sessdata = \"".$val."\" WHERE sesskey = '".$sessid."'"; } ! $queryWorked = $db->query($update); $updateWorked = $db->getAffectedRows(); if ($updateWorked < 0) { ! // die('update did not work ' .$updateWorked. "\n <br>".$s); $e = ErrorStack::pullError('php'); *************** *** 446,454 **** $queryWorked = $db->query($s); $e = ErrorStack::pullError('php'); ! $s="INSERT into lcSessions (username,sessdata,sesskey) values ('".$this->username."','$val','$sessid')"; ! if ($this->username == "anonymous" ) { ! $s="INSERT into lcSessions (sessdata,sesskey) values ('$val','$sessid')"; ! } $db->query($s); } return true; --- 446,463 ---- $queryWorked = $db->query($s); $e = ErrorStack::pullError('php'); ! ! //try the update again ! // could be duplicate key on username, or on session ID $db->query($s); + $queryWorked = $db->query($update); + $updateWorked = $db->getAffectedRows(); + if ($updateWorked < 0) { + $e = ErrorStack::pullError('php'); + $s="INSERT into lcSessions (username,sessdata,sesskey) values ('".$this->username."','$val','$sessid')"; + if ($this->username == "anonymous" ) { + $s="INSERT into lcSessions (sessdata,sesskey) values ('$val','$sessid')"; + } + $db->query($s); + } } return true; |