summaryrefslogtreecommitdiff
path: root/inc/auth.php
diff options
context:
space:
mode:
authorTim Roes <mail@timroes.de>2012-05-07 17:08:35 +0200
committerTim Roes <mail@timroes.de>2012-05-07 17:08:35 +0200
commitefa78c8638547cab77a37006e7f86aed792a1609 (patch)
tree492804d80b28f8e32785b3648d9e03e77804b50f /inc/auth.php
parentae992f53831c105d6deacfef79d7723b22a00033 (diff)
parentf774b92a94947b3eabd64919b6b4ba74f9c4b5fd (diff)
downloadrpg-efa78c8638547cab77a37006e7f86aed792a1609.tar.gz
rpg-efa78c8638547cab77a37006e7f86aed792a1609.tar.bz2
Merge branch 'master' of https://github.com/splitbrain/dokuwiki
Diffstat (limited to 'inc/auth.php')
-rw-r--r--inc/auth.php50
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);