diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/auth.php | 3 | ||||
-rw-r--r-- | inc/changelog.php | 4 | ||||
-rw-r--r-- | inc/media.php | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/inc/auth.php b/inc/auth.php index 5625d6efb..23031a29c 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -245,12 +245,13 @@ function auth_createToken(){ * @return string a MD5 sum of various browser headers */ function auth_browseruid(){ + $ip = clientIP(true); $uid = ''; $uid .= $_SERVER['HTTP_USER_AGENT']; $uid .= $_SERVER['HTTP_ACCEPT_ENCODING']; $uid .= $_SERVER['HTTP_ACCEPT_LANGUAGE']; $uid .= $_SERVER['HTTP_ACCEPT_CHARSET']; - $uid .= substr($_SERVER['REMOTE_ADDR'],0,strpos($_SERVER['REMOTE_ADDR'],'.')); + $uid .= substr($ip,0,strpos($ip,'.')); return md5($uid); } diff --git a/inc/changelog.php b/inc/changelog.php index 20e2ae340..debbc2834 100644 --- a/inc/changelog.php +++ b/inc/changelog.php @@ -55,7 +55,7 @@ function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extr $wasRemoved = ($type===DOKU_CHANGE_TYPE_DELETE); if(!$date) $date = time(); //use current time if none supplied - $remote = (!$flagExternalEdit)?$_SERVER['REMOTE_ADDR']:'127.0.0.1'; + $remote = (!$flagExternalEdit)?clientIP(true):'127.0.0.1'; $user = (!$flagExternalEdit)?$_SERVER['REMOTE_USER']:''; $strip = array("\t", "\n"); @@ -109,7 +109,7 @@ function addMediaLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $id = cleanid($id); if(!$date) $date = time(); //use current time if none supplied - $remote = $_SERVER['REMOTE_ADDR']; + $remote = clientIP(true); $user = $_SERVER['REMOTE_USER']; $strip = array("\t", "\n"); diff --git a/inc/media.php b/inc/media.php index 2ea77d34c..d4aa751bd 100644 --- a/inc/media.php +++ b/inc/media.php @@ -401,11 +401,13 @@ function media_notify($id,$file,$mime){ global $conf; if(empty($conf['notify'])) return; //notify enabled? + $ip = clientIP(); + $text = rawLocale('uploadmail'); $text = str_replace('@DATE@',strftime($conf['dformat']),$text); $text = str_replace('@BROWSER@',$_SERVER['HTTP_USER_AGENT'],$text); - $text = str_replace('@IPADDRESS@',$_SERVER['REMOTE_ADDR'],$text); - $text = str_replace('@HOSTNAME@',gethostbyaddr($_SERVER['REMOTE_ADDR']),$text); + $text = str_replace('@IPADDRESS@',$ip,$text); + $text = str_replace('@HOSTNAME@',gethostsbyaddrs($ip),$text); $text = str_replace('@DOKUWIKIURL@',DOKU_URL,$text); $text = str_replace('@USER@',$_SERVER['REMOTE_USER'],$text); $text = str_replace('@MIME@',$mime,$text); |