From 9998bd24d6f4a6aac27ef680f2069532b2c35640 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 14 Feb 2007 20:05:18 +0000 Subject: [PATCH] r1410: Moving the password reset email to the template system --- login.php | 19 +++++-------------- templates/email/passwordreset.xml.tpl | 10 ++++++++++ 2 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 templates/email/passwordreset.xml.tpl diff --git a/login.php b/login.php index 0732638..31e6b0d 100755 --- a/login.php +++ b/login.php @@ -136,20 +136,11 @@ if ($_POST['do'] == 'sendpw') $activator = $funct->rand(25); $db->query("INSERT INTO " . TABLE_PREFIX . "passwordreset (activatorid, dateline, userid) VALUES ('" . $activator . "', " . TIMENOW . ", " . $user->objdata['userid'] . ")"); - $mail->setSubject(sprintf(_('%1$s Password Reset'), $bugsys->options['trackertitle'])); - $mail->setBodyText(sprintf(_('Hi %1$s, - -You requested this lost password email at the %2$s bug tracker. To reset your password, simply click the link below (or paste it into your browser window exactly) and enter a new password. - -%3$s/login.php?do=recoverpw&activator=%4$s - -If you did not request this, do not worry as this notice will expire in 24 hours.'), - - $user->objdata['displayname'], - $bugsys->options['trackertitle'], - $bugsys->options['trackerurl'], - $activator - )); + eval('$email = "' . $template->fetch('email/passwordreset.xml') . '";'); + $email = $bugsys->xml->parse($email); + + $mail->setSubject($email['email']['subject']['value']); + $mail->setBodyText($email['email']['bodyText']['value']); $mail->send($user->objdata['email'], $user->objdata['displayname']); diff --git a/templates/email/passwordreset.xml.tpl b/templates/email/passwordreset.xml.tpl new file mode 100644 index 0000000..55e4f51 --- /dev/null +++ b/templates/email/passwordreset.xml.tpl @@ -0,0 +1,10 @@ + + $bugsys->options['trackertitle'] Password Reset + Hi {$user->objdata['displayname']}, + +You requested this lost password email at the {$bugsys->options['trackertitle']} bug tracker. To reset your password, simply click the link below (or paste it into your browser window exactly) and enter a new password. + +{$bugsys->options['trackerurl']}/login.php?do=recoverpw&activator=$activator + +If you did not request this, do not worry as this notice will expire in 24 hours. + \ No newline at end of file -- 2.43.5