diff options
author | Andreas Gohr <andi@splitbrain.org> | 2012-04-20 12:03:03 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2012-04-20 12:03:03 +0200 |
commit | c67addf8c8a91cb62cdadb0f39683cdf0e2ea9fd (patch) | |
tree | b583681b3898684590af39a2fc0a0446169e3cad /inc/auth.php | |
parent | 2f85287ef7aafab72cec14c85c1ab4cd1d7facc9 (diff) | |
parent | 8aea63819532f5f49c22a3a225e18eb2640f1d71 (diff) | |
download | rpg-c67addf8c8a91cb62cdadb0f39683cdf0e2ea9fd.tar.gz rpg-c67addf8c8a91cb62cdadb0f39683cdf0e2ea9fd.tar.bz2 |
Merge branch 'htmlmail'
* htmlmail: (26 commits)
changed internal Mailer members from private to protected
made it possible to disable HTML mails in the config
removed commented code left from the quoted_printable days
add missing table tags for HTML diff mails
fixed subscriber mail signatures
use real HRs in HTML mails
Add various headers to the mails FS#2247. pull request #83 closed
removed footer image from HTML mails
use inlinestyles for diffs in HTML mails
fixed signature stripping
fixed mailprefix handling
fixed missing replacement for HTML notify mails
allow image embeds in HTML mail templates
Added HTML wrapper for mails
allow non-txt extensions when accessing locales
added Mailer class to autoloader
Replaced mail_send calls with new Mailer class
Make use of new Mailer class in notify()
Copy all text replacements to HTML replacements in Mailer
Added setBody() to Mailer class
...
Diffstat (limited to 'inc/auth.php')
-rw-r--r-- | inc/auth.php | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/inc/auth.php b/inc/auth.php index 59ef1cb54..ed0e2dcf7 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -669,22 +669,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); - - if(empty($conf['mailprefix'])) { - $subject = $lang['regpwmail']; - } else { - $subject = '['.$conf['mailprefix'].'] '.$lang['regpwmail']; - } + $trep = array( + 'FULLNAME' => $userinfo['name'], + 'LOGIN' => $user, + 'PASSWORD' => $password + ); - return mail_send($userinfo['name'].' <'.$userinfo['mail'].'>', - $subject, - $text, - $conf['mailfrom']); + $mail = new Mailer(); + $mail->to($userinfo['name'].' <'.$userinfo['mail'].'>'); + $mail->subject($lang['regpwmail']); + $mail->setBody($text,$trep); + return $mail->send(); } /** @@ -941,22 +936,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(empty($conf['mailprefix'])) { - $subject = $lang['regpwmail']; - } else { - $subject = '['.$conf['mailprefix'].'] '.$lang['regpwmail']; - } + $trep = array( + 'FULLNAME' => $userinfo['name'], + 'LOGIN' => $user, + 'CONFIRM' => $url + ); - if(mail_send($userinfo['name'].' <'.$userinfo['mail'].'>', - $subject, - $text, - $conf['mailfrom'])){ + $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); |