Changeset 7 for branches/2/user.php
- Timestamp:
- May 9, 2008, 7:24:45 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2/user.php
r5 r7 27 27 { 28 28 // Refresh time of last access 29 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('Time' => time()));30 } else $this->Database->insert('UserOnline', array('SessionId' => $SID, 'User' => 0, 'Time' => time(), 'IpAddress' => (gethostbyaddr(GetRemoteAddress()).' '.GetRemoteAddress())));29 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('Time' => 'NOW()')); 30 } else $this->Database->insert('UserOnline', array('SessionId' => $SID, 'User' => 0, 'Time' => 'NOW()', 'IpAddress' => (gethostbyaddr(GetRemoteAddress()).' '.GetRemoteAddress()))); 31 31 32 32 // Odeber neaktivní uživatele 33 $this->Database->delete('UserOnline', 'Time < '.(time() - USER_TIMEOUT));33 $this->Database->delete('UserOnline', 'Time < DATE_SUB(NOW(), INTERVAL '.USER_TIMEOUT.' SECOND)'); 34 34 35 35 // Zkontroluj přihlášení … … 39 39 { 40 40 $Query = $this->Database->select('User', '*', "Id='".$Row['User']."'"); 41 $ User = $Query->fetch_array();41 $this->User = $Query->fetch_array(); 42 42 $Result = USER_LOGGED; 43 43 } else { 44 $ User = array('FullName' => 'Návštěvník', 'Id' => 0, 'Name' => 'Anonym');44 $this->User = array('FullName' => 'Návštěvník', 'Id' => 0, 'Name' => 'Anonym'); 45 45 $Result = USER_NOT_LOGGED; 46 46 } … … 71 71 // Je uživatel registrován? 72 72 $Query = $this->Database->select('User', '*', 'Name="'.$Nick.'"'); 73 if($Query->num_rows ()> 0)73 if($Query->num_rows > 0) 74 74 { 75 75 $Row = $Query->fetch_array(); … … 89 89 { 90 90 $SID = session_id(); 91 $this->Database->update('User sOnline', 'SessionId="'.$SID.'"', array('User' => 0));91 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => 0)); 92 92 return(USER_LOGGED_OUT); 93 93 }
Note:
See TracChangeset
for help on using the changeset viewer.