Changeset 805 for trunk/Modules
- Timestamp:
- May 24, 2014, 11:35:47 PM (11 years ago)
- Location:
- trunk/Modules
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/ProcessAoWoWExport.php
r737 r805 2 2 3 3 ini_set('memory_limit', '100M'); 4 5 $_SERVER['REMOTE_ADDR'] = '127.0.0.1';6 $_SERVER['REQUEST_URI'] = __FILE__;7 4 8 5 include_once('../../includes/global.php'); … … 14 11 $System->DoNotShowPage = true; 15 12 $System->Run(); 16 17 $_SERVER['REQUEST_URI'] = __FILE__;18 13 19 14 $Output = ''; -
trunk/Modules/Export/ProcessTask.php
r776 r805 2 2 3 3 ini_set('memory_limit', '100M'); 4 5 $_SERVER['REMOTE_ADDR'] = '127.0.0.1';6 $_SERVER['REQUEST_URI'] = __FILE__;7 4 8 5 include_once(dirname(__FILE__).'/../../includes/global.php'); -
trunk/Modules/Export/cmdmpqexport.php
r741 r805 2 2 3 3 ini_set('memory_limit', '100M'); 4 5 $_SERVER['REMOTE_ADDR'] = '127.0.0.1';6 $_SERVER['REQUEST_URI'] = __FILE__;7 4 8 5 include_once(dirname(__FILE__).'/../../includes/global.php'); -
trunk/Modules/Forum/Forum.php
r792 r805 261 261 $this->System->Database->query('INSERT INTO `'.$Table.'` ( `User`, `UserName` , `Text` , `Date` , `IP` , `Thread` ) '. 262 262 ' VALUES ('.$this->System->User->Id.', "'.$this->System->User->Name. 263 '", "'.$Text.'", NOW(), "'. $_SERVER['REMOTE_ADDR'].'","'.$_GET['Thread'].'")');263 '", "'.$Text.'", NOW(), "'.GetRemoteAddress().'","'.$_GET['Thread'].'")'); 264 264 } else $Output .= ShowMessage(T('Item not found'), MESSAGE_CRITICAL); 265 265 } else 266 266 $this->System->Database->query('INSERT INTO `'.$Table.'` ( `User`, `UserName` , `Text` , `Date` , `IP`) '. 267 267 ' VALUES ('.$this->System->User->Id.', "'.$this->System->User->Name. 268 '", "'.$Text.'", NOW(), "'. $_SERVER['REMOTE_ADDR'].'")');268 '", "'.$Text.'", NOW(), "'.GetRemoteAddress().'")'); 269 269 $Output .= ShowMessage(T('Added.')); 270 270 } -
trunk/Modules/Import/cmd.php
r727 r805 1 1 <?php 2 3 $_SERVER['REMOTE_ADDR'] = '127.0.0.1';4 $_SERVER['REQUEST_URI'] = __FILE__;5 6 2 7 3 include_once('../../includes/global.php'); … … 13 9 $System->Run(); 14 10 $Import = new Import($System); 15 $_SERVER['REQUEST_URI'] = __FILE__;16 11 17 12 $Output = ''; -
trunk/Modules/Log/Log.php
r765 r805 33 33 function WriteLog($Text, $Type) 34 34 { 35 if(!isset($_SERVER['REMOTE_ADDR'])) $IP = 'Konzole'; 36 else $IP = addslashes($_SERVER['REMOTE_ADDR']); 37 38 if(isset($this->System->User) and !is_null($this->System->User->Id)) $UserId = $this->System->User->Id; 35 if(isset($this->System->User) and !is_null($this->System->User->Id)) 36 $UserId = $this->System->User->Id; 39 37 else $UserId = 'NULL'; 40 38 $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP`, `URL` ) '. 41 'VALUES ('.$UserId.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$IP.'", "'.$_SERVER['REQUEST_URI'].'")'; 39 'VALUES ('.$UserId.', '.$Type.', "'.addslashes($Text).'", NOW(), "'. 40 GetRemoteAddress().'", "'.GetRequestURI().'")'; 42 41 $this->System->Database->query($Query); 43 42 } … … 60 59 { 61 60 global $System, $User; 62 63 if(!isset($_SERVER['REMOTE_ADDR'])) $IP = 'Konzole'; 64 else $IP = addslashes($_SERVER['REMOTE_ADDR']); 65 61 66 62 if(isset($User) and !is_null($User->Id)) $UserId = $User->Id; 67 63 else $UserId = 'NULL'; 68 64 $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP`, `URL` ) '. 69 'VALUES ('.$UserId.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$IP.'", "'.$_SERVER['REQUEST_URI'].'")'; 65 'VALUES ('.$UserId.', '.$Type.', "'.addslashes($Text).'", NOW(), "'. 66 GetRemoteAddress().'", "'.GetRequestURI().'")'; 70 67 $System->Database->query($Query); 71 68 } -
trunk/Modules/Referrer/Referrer.php
r804 r805 40 40 if(!in_array($HostName, $this->Excludes)) 41 41 { 42 if(!isset($_SERVER['REMOTE_ADDR'])) $IP = 'Konzole'; 43 else $IP = addslashes($_SERVER['REMOTE_ADDR']); 44 42 $IP = GetRemoteAddress(); 43 45 44 // Check if client IP is not blocked as spam source 46 45 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Referrer` WHERE `LastIP` = "'.$IP.'" AND (`Visible` = 0)'); -
trunk/Modules/ShoutBox/ShoutBox.php
r765 r805 125 125 $this->System->Database->query('INSERT INTO `ShoutBox` ( `User`, `UserName` , `Text` , `Date` , `IP` ) '. 126 126 ' VALUES ('.$this->System->User->Id.', "'.$this->System->User->Name. 127 '", "'.$Text.'", NOW(), "'. $_SERVER['REMOTE_ADDR'].'")');127 '", "'.$Text.'", NOW(), "'.GetRemoteAddress().'")'); 128 128 $Output .= ShowMessage('Zpráva vložena.'); 129 129 } -
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.