Changeset 9 for branches/2/user.php
- Timestamp:
- May 9, 2008, 2:04:07 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2/user.php
r8 r9 19 19 var $User = array(); 20 20 var $DefaultRole = 2; 21 var $AnonymousUserId = 1; 21 22 22 23 function Check() … … 30 31 // Refresh time of last access 31 32 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('Time' => 'NOW()')); 32 } else $this->Database->insert('UserOnline', array('SessionId' => $SID, 'User' => 1, 'Time' => 'NOW()', 'IpAddress' => (gethostbyaddr(GetRemoteAddress()).' '.GetRemoteAddress())));33 } else $this->Database->insert('UserOnline', array('SessionId' => $SID, 'User' => $AnonymousUserId, 'Time' => 'NOW()', 'IpAddress' => (gethostbyaddr(GetRemoteAddress()).' '.GetRemoteAddress()))); 33 34 34 35 // Odeber neaktivní uživatele … … 38 39 $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"'); 39 40 $Row = $Query->fetch_array(); 40 if($Row['User'] != 0)41 if($Row['User'] != $this->AnonymousUserId) 41 42 { 42 43 $Query = $this->Database->select('User', '*', "Id=".$Row['User'].""); … … 44 45 $Result = USER_LOGGED; 45 46 } else { 46 $Query = $this->Database->select('User', '*', "Id= 1");47 $Query = $this->Database->select('User', '*', "Id=".$this->AnonymousUserId); 47 48 $this->User = $Query->fetch_array(); 48 49 $Result = USER_NOT_LOGGED; … … 97 98 { 98 99 $SID = session_id(); 99 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => 1));100 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => $this->AnonymousUserId)); 100 101 return(USER_LOGGED_OUT); 101 102 }
Note:
See TracChangeset
for help on using the changeset viewer.