diff options
author | chris <chris@jalakai.co.uk> | 2006-08-22 09:24:44 +0200 |
---|---|---|
committer | chris <chris@jalakai.co.uk> | 2006-08-22 09:24:44 +0200 |
commit | 02a498e7884db0beaec6950e3b36bf4384daba93 (patch) | |
tree | 343727dac178c158b113758b777a2d97cb5af548 | |
parent | c93ca5e664887c483a60e441291b921c93747e13 (diff) | |
download | rpg-02a498e7884db0beaec6950e3b36bf4384daba93.tar.gz rpg-02a498e7884db0beaec6950e3b36bf4384daba93.tar.bz2 |
bug #876, additional data for new user notification email
This patch updates only the english version of the localised
"registermail.txt" file. Other versions need to be updated also.
darcs-hash:20060822072444-9b6ab-ff6cb5bc78277c383e82c3986eeb16168e86c27b.gz
-rw-r--r-- | inc/auth.php | 11 | ||||
-rw-r--r-- | inc/common.php | 7 | ||||
-rw-r--r-- | inc/lang/en/registermail.txt | 4 |
3 files changed, 19 insertions, 3 deletions
diff --git a/inc/auth.php b/inc/auth.php index 6e97b12c0..40145ee78 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -501,16 +501,23 @@ function register(){ return false; } + // create substitutions for use in notification email + $substitutions = array( + 'NEWUSER' => $_POST['login'], + 'NEWNAME' => $_POST['fullname'], + 'NEWEMAIL' => $_POST['email'], + ); + if (!$conf['autopasswd']) { msg($lang['regsuccess2'],1); - notify('', 'register', '', $_POST['login'], false); + notify('', 'register', '', $_POST['login'], false, $substitutions); return true; } // autogenerated password? then send him the password if (auth_sendPassword($_POST['login'],$pass)){ msg($lang['regsuccess'],1); - notify('', 'register', '', $_POST['login'], false); + notify('', 'register', '', $_POST['login'], false, $substitutions); return true; }else{ msg($lang['regmailfail'],-1); diff --git a/inc/common.php b/inc/common.php index bed5105fb..3064c4fda 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1111,10 +1111,11 @@ function saveOldRevision($id){ * @param int $rev Old page revision * @param string $summary What changed * @param boolean $minor Is this a minor edit? + * @param array $replace Additional string substitutions, @KEY@ to be replaced by value * * @author Andreas Gohr <andi@splitbrain.org> */ -function notify($id,$who,$rev='',$summary='',$minor=false){ +function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ global $lang; global $conf; @@ -1151,6 +1152,10 @@ function notify($id,$who,$rev='',$summary='',$minor=false){ $text = str_replace('@SUMMARY@',$summary,$text); $text = str_replace('@USER@',$_SERVER['REMOTE_USER'],$text); + foreach ($replace as $key => $substitution) { + $text = str_replace('@'.strtoupper($key).'@',$substitution, $text); + } + if($who == 'register'){ $subject = $lang['mail_new_user'].' '.$summary; }elseif($rev){ diff --git a/inc/lang/en/registermail.txt b/inc/lang/en/registermail.txt index 53ffcab70..f5ab7e4ea 100644 --- a/inc/lang/en/registermail.txt +++ b/inc/lang/en/registermail.txt @@ -1,5 +1,9 @@ A new user has registered. Here are the details: +User name : @NEWUSER@ +Full name : @NEWNAME@ +Email : @NEWEMAIL@ + Date : @DATE@ Browser : @BROWSER@ IP-Address : @IPADDRESS@ |