summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/auth.php11
-rw-r--r--inc/common.php7
-rw-r--r--inc/lang/en/registermail.txt4
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@