summaryrefslogtreecommitdiff
path: root/inc/auth.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2011-11-12 17:50:47 +0100
committerAndreas Gohr <andi@splitbrain.org>2011-11-12 17:50:47 +0100
commitd7169d19cde6fc49e27e7444e424549212339ff9 (patch)
tree50e43e13dd1bbc0e1a079908d37bc19e5cef1325 /inc/auth.php
parent6df843ee8dd8133de3e4e8d5cb742d2afa5f6761 (diff)
downloadrpg-d7169d19cde6fc49e27e7444e424549212339ff9.tar.gz
rpg-d7169d19cde6fc49e27e7444e424549212339ff9.tar.bz2
Replaced mail_send calls with new Mailer class
Diffstat (limited to 'inc/auth.php')
-rw-r--r--inc/auth.php42
1 files changed, 22 insertions, 20 deletions
diff --git a/inc/auth.php b/inc/auth.php
index eff984b36..49346a84f 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -667,16 +667,17 @@ function auth_sendPassword($user,$password){
if(!$userinfo['mail']) return false;
$text = rawLocale('password');
- $text = str_replace('@DOKUWIKIURL@',DOKU_URL,$text);
- $text = str_replace('@FULLNAME@',$userinfo['name'],$text);
- $text = str_replace('@LOGIN@',$user,$text);
- $text = str_replace('@PASSWORD@',$password,$text);
- $text = str_replace('@TITLE@',$conf['title'],$text);
-
- return mail_send($userinfo['name'].' <'.$userinfo['mail'].'>',
- $lang['regpwmail'],
- $text,
- $conf['mailfrom']);
+ $trep = array(
+ 'FULLNAME' => $userinfo['name'],
+ 'LOGIN' => $user,
+ 'PASSWORD' => $password
+ );
+
+ $mail = new Mailer();
+ $mail->to($userinfo['name'].' <'.$userinfo['mail'].'>');
+ $mail->subject($lang['regpwmail']);
+ $mail->setBody($text,$trep);
+ return $mail->send();
}
/**
@@ -906,16 +907,17 @@ function act_resendpwd(){
io_saveFile($tfile,$user);
$text = rawLocale('pwconfirm');
- $text = str_replace('@DOKUWIKIURL@',DOKU_URL,$text);
- $text = str_replace('@FULLNAME@',$userinfo['name'],$text);
- $text = str_replace('@LOGIN@',$user,$text);
- $text = str_replace('@TITLE@',$conf['title'],$text);
- $text = str_replace('@CONFIRM@',$url,$text);
-
- if(mail_send($userinfo['name'].' <'.$userinfo['mail'].'>',
- $lang['regpwmail'],
- $text,
- $conf['mailfrom'])){
+ $trep = array(
+ 'FULLNAME' => $userinfo['name'],
+ 'LOGIN' => $user,
+ 'CONFIRM' => $url
+ );
+
+ $mail = new Mailer();
+ $mail->to($userinfo['name'].' <'.$userinfo['mail'].'>');
+ $mail->subject($lang['regpwmail']);
+ $mail->setBody($text,$trep);
+ if($mail->send()){
msg($lang['resendpwdconfirm'],1);
}else{
msg($lang['regmailfail'],-1);