Changeset 52 for trunk/www/user.php


Ignore:
Timestamp:
Jun 20, 2009, 6:22:13 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Spuštěcí skript serverů start.sh spustí procesy emulátoru pouze pokud ještě nejsou spouštěné.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/user.php

    r49 r52  
    4545    $SID = session_id();
    4646
     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
    4755    // Lookup user record
    4856    $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"');
     
    6573      $Result = USER_NOT_LOGGED;
    6674    }
    67 
    68     // Remove nonactive users
    69     $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 record
    77     $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']));
    8075
    8176    // Refresh time of last access
Note: See TracChangeset for help on using the changeset viewer.