Skip to content
Snippets Groups Projects
Commit 63211f61 authored by Glen Harris's avatar Glen Harris
Browse files

Show proxy path in notify mails FS#1308

darcs-hash:20080118201511-f6de1-13f0ffff4f546298cce1a4e3dcd2d9679217ace8.gz
parent 4e037c98
No related branches found
No related tags found
No related merge requests found
...@@ -576,6 +576,21 @@ function clientIP($single=false){ ...@@ -576,6 +576,21 @@ function clientIP($single=false){
return $ip[0]; return $ip[0];
} }
/**
* Convert one or more comma separated IPs to hostnames
*
* @author Glen Harris <astfgl@iamnota.org>
* @returns a comma separated list of hostnames
*/
function gethostsbyaddrs($ips){
$hosts = array();
$ips = explode(',',$ips);
foreach($ip as $ip){
$host[] = gethostbyaddr(trim($ip));
}
return join(',',$host);;
}
/** /**
* Checks if a given page is currently locked. * Checks if a given page is currently locked.
* *
...@@ -892,10 +907,11 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ ...@@ -892,10 +907,11 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){
return; //just to be safe return; //just to be safe
} }
$ip = clientIP();
$text = str_replace('@DATE@',date($conf['dformat']),$text); $text = str_replace('@DATE@',date($conf['dformat']),$text);
$text = str_replace('@BROWSER@',$_SERVER['HTTP_USER_AGENT'],$text); $text = str_replace('@BROWSER@',$_SERVER['HTTP_USER_AGENT'],$text);
$text = str_replace('@IPADDRESS@',$_SERVER['REMOTE_ADDR'],$text); $text = str_replace('@IPADDRESS@',$ip,$text);
$text = str_replace('@HOSTNAME@',gethostbyaddr($_SERVER['REMOTE_ADDR']),$text); $text = str_replace('@HOSTNAME@',gethostsbyaddrs($ip),$text);
$text = str_replace('@NEWPAGE@',wl($id,'',true,'&'),$text); $text = str_replace('@NEWPAGE@',wl($id,'',true,'&'),$text);
$text = str_replace('@PAGE@',$id,$text); $text = str_replace('@PAGE@',$id,$text);
$text = str_replace('@TITLE@',$conf['title'],$text); $text = str_replace('@TITLE@',$conf['title'],$text);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment