Changeset 805 for trunk/Modules/User/User.php
- Timestamp:
- May 24, 2014, 11:35:47 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/User.php
r801 r805 137 137 $this->Database->query('UPDATE `UserTrace` SET '. 138 138 '`LastLogin` = NOW(), '. 139 '`LastIP` = "'. $_SERVER['REMOTE_ADDR'].'", '.139 '`LastIP` = "'.GetRemoteAddress().'", '. 140 140 '`UserAgent` = "'.$this->System->Database->real_escape_string($_SERVER['HTTP_USER_AGENT']).'" '. 141 141 ' WHERE `User` = '.$this->Id); … … 194 194 function Licence($Licence) 195 195 { 196 if( !isset($_SERVER['REMOTE_ADDR'])) return(true); // Execution from command line197 else return($this->Role >= $Licence);196 if(GetRemoteAddress() == '') return(true); // Execution from command line 197 else return($this->Role >= $Licence); 198 198 } 199 199 … … 229 229 // Refresh time of last access 230 230 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('ActivityTime' => 'NOW()')); 231 } else $this->Database->insert('UserOnline', array('SessionId' => $SID, 231 } else { 232 if(GetRemoteAddress() != '') $HostName = gethostbyaddr(GetRemoteAddress()); 233 else $HostName = ''; 234 $this->Database->insert('UserOnline', array('SessionId' => $SID, 232 235 'User' => null, 'LoginTime' => 'NOW()', 'ActivityTime' => 'NOW()', 233 'IpAddress' => GetRemoteAddress(), 'HostName' => gethostbyaddr(GetRemoteAddress()), 234 'ScriptName' => $_SERVER['REQUEST_URI'])); 235 236 'IpAddress' => GetRemoteAddress(), 'HostName' => $HostName, 237 'ScriptName' => GetRequestURI())); 238 } 239 236 240 // Logged permanently? 237 241 if(array_key_exists('LoginHash', $_COOKIE)) … … 281 285 $UserId = $this->Database->insert_id; 282 286 $this->Database->query('INSERT INTO `UserTrace` (`User`, `LastIP`, `UserAgent`) '. 283 'VALUES ('.$UserId.', "'. $_SERVER['REMOTE_ADDR'].'", '.287 'VALUES ('.$UserId.', "'.GetRemoteAddress().'", '. 284 288 '"'.$this->Database->real_escape_string($_SERVER['HTTP_USER_AGENT']).'")'); 285 289 }
Note:
See TracChangeset
for help on using the changeset viewer.