diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-12-05 21:19:57 +0100 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-12-05 21:19:57 +0100 |
commit | 30d7d7185531fa4b68ece7f3b11ca855e1fd5b5a (patch) | |
tree | 11428e4a0e629dffde865c84c02cd77ddabeacab /inc/common.php | |
parent | 3d3c095d598070a3ccf1399c4c460bb1243e68dd (diff) | |
download | rpg-30d7d7185531fa4b68ece7f3b11ca855e1fd5b5a.tar.gz rpg-30d7d7185531fa4b68ece7f3b11ca855e1fd5b5a.tar.bz2 |
allow dynamic e-mail "from" addresses when doing notification
this patch allows you to use @USER@ / @NAME@ / @MAIL@ in the "from" address
when sending a mail notification e-mail
darcs-hash:20061205201957-5224c-5637d6412106cb16af8817f07c8c02e95e4b3088.gz
Diffstat (limited to 'inc/common.php')
-rw-r--r-- | inc/common.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/inc/common.php b/inc/common.php index 711df9d11..8ca29b918 100644 --- a/inc/common.php +++ b/inc/common.php @@ -810,6 +810,7 @@ function saveOldRevision($id){ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ global $lang; global $conf; + global $INFO; // decide if there is something to do if($who == 'admin'){ @@ -866,7 +867,12 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ $text = str_replace('@DIFF@',$diff,$text); $subject = '['.$conf['title'].'] '.$subject; - mail_send($to,$subject,$text,$conf['mailfrom'],'',$bcc); + $from = $conf['mailfrom']; + $from = str_replace('@USER@',$_SERVER['REMOTE_USER'],$from); + $from = str_replace('@NAME@',$INFO['userinfo']['name'],$from); + $from = str_replace('@MAIL@',$INFO['userinfo']['mail'],$from); + + mail_send($to,$subject,$text,$from,'',$bcc); } /** |