|
From: Lo?c C. <lo...@us...> - 2001-04-13 10:29:21
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib
In directory usw-pr-cvs1:/tmp/cvs-serv25488/chat/lib
Modified Files:
db_sessions.lib.php3
Log Message:
Fix two big problems: session last log time wasn't updated if no message is sent and starting chat page reloads in hidden frames when session was out
Index: db_sessions.lib.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/db_sessions.lib.php3,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** db_sessions.lib.php3 2001/04/11 23:06:14 1.4
--- db_sessions.lib.php3 2001/04/13 10:29:19 1.5
***************
*** 615,618 ****
--- 615,654 ----
/**
+ * Update the last log time without modifying session data
+ *
+ * @global object the database handler
+ * @global string the name or the table to use for sessions
+ * @global string the current session ID
+ *
+ * @return boolean true on success and false on failure
+ *
+ * @access public
+ */
+ function dbSessionUpdateLogTime()
+ {
+ global $dbSessionDbLink;
+ global $dbSessionDbTable;
+ global $dbSessionId;
+
+ // Ensure the database link for sessions is defined
+ if (empty($dbSessionDbLink))
+ {
+ dbSessionSetErrorMsg(3);
+ return false;
+ }
+
+ // Ensure the session ID has been defined
+ if (empty($dbSessionId))
+ {
+ dbSessionSetErrorMsg(4);
+ return false;
+ }
+
+ $dbSessionDbLink->query("UPDATE $dbSessionDbTable SET last = " . time() . " WHERE session_id = '$dbSessionId'");
+ return ($dbSessionDbLink->affectedRows() > 0) ? true : false;
+ }
+
+
+ /**
* Save all data registered to a session
*
|