Changeset 52 for trunk/www/user.php
- Timestamp:
- Jun 20, 2009, 6:22:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/user.php
r49 r52 45 45 $SID = session_id(); 46 46 47 // Remove nonactive users 48 $DbResult = $this->Database->select('UserOnline', 'Id, User', 'ActivityTime < DATE_SUB(NOW(), INTERVAL '.$this->OnlineStateTimeout.' SECOND)'); 49 while($DbRow = $DbResult->fetch_array()) 50 { 51 if($DbRow['User'] != $this->AnonymousUserId) $this->System->Modules['Log']->NewRecord('User', 'Logout'); 52 $this->Database->delete('UserOnline', 'Id='.$DbRow['Id']); 53 } 54 47 55 // Lookup user record 48 56 $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"'); … … 65 73 $Result = USER_NOT_LOGGED; 66 74 } 67 68 // Remove nonactive users69 $DbResult = $this->Database->select('UserOnline', 'Id, User', 'ActivityTime < DATE_SUB(NOW(), INTERVAL '.$this->OnlineStateTimeout.' SECOND)');70 while($DbRow = $DbResult->fetch_array())71 {72 if($DbRow['User'] != $this->AnonymousUserId) $this->System->Modules['Log']->NewRecord('User', 'Logout');73 $this->Database->delete('UserOnline', 'Id='.$DbRow['Id']);74 }75 76 // Lookup user record77 $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"');78 if($Query->num_rows == 0)79 $this->Database->insert('UserOnline', array('SessionId' => $SID, 'User' => $this->AnonymousUserId, 'LoginTime' => 'NOW()', 'ActivityTime' => 'NOW()', 'IpAddress' => GetRemoteAddress(), 'HostName' => gethostbyaddr(GetRemoteAddress()), 'ScriptName' => $_SERVER['PHP_SELF']));80 75 81 76 // Refresh time of last access
Note:
See TracChangeset
for help on using the changeset viewer.