Update of /cvsroot/phpmp/phpMP/includes
In directory usw-pr-cvs1:/tmp/cvs-serv5237/includes
Modified Files:
auth.php sessions.php
Log Message:
Updated MySQL database structure. Fixed session cleanup problem (by adding
an extra function that should work fine).
Index: auth.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/includes/auth.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** auth.php 29 Jul 2002 11:13:04 -0000 1.16
--- auth.php 31 Jul 2002 17:48:38 -0000 1.17
***************
*** 43,49 ****
--- 43,66 ----
var $mpcookie;
+ function session_cleanup() {
+
+ global $MPCONF, $DBA;
+
+ $rand_val = rand(0, 10);
+ if($rand_val > 8) {
+
+ $result = $DBA->query("DELETE FROM " . $MPCONF['DB']['table_prefix'] . "sessions WHERE expiretime < " . time());
+
+ return $DBA->affected_rows();
+
+ }
+
+ }
+
function AuthUser() {
global $MPCONF, $Functions, $DBA, $HTTP_POST_VARS;
+
+ $this->session_cleanup();
if(empty($HTTP_POST_VARS['username'])) {
Index: sessions.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/includes/sessions.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** sessions.php 27 Jul 2002 12:16:00 -0000 1.3
--- sessions.php 31 Jul 2002 17:48:38 -0000 1.4
***************
*** 85,89 ****
global $MPCONF, $DBA;
! $retval = mysql_query("DELETE FROM " . $MPCONF['DB']['table_prefix'] . "sessions WHERE expiretime < " . time());
return $DBA->affected_rows();
--- 85,89 ----
global $MPCONF, $DBA;
! $retval = $DBA->query("DELETE FROM " . $MPCONF['DB']['table_prefix'] . "sessions WHERE expiretime < " . time());
return $DBA->affected_rows();
|