From 6c66afdc57de90f51a4bb03a8946d78318933bc5 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 19 Mar 2007 17:39:47 +0000 Subject: [PATCH] r1512: In the approve users section of admin/usergroup.php, we were still using the mailing system from ISSO 2.0. Switched to using template-based emailing (which requires us to load the template system in that one file). Added templates/email/accountapproved.xml.tpl --- admin/usergroup.php | 25 +++++++++++-------------- docs/changes.txt | 1 + templates/email/accountapproved.xml.tpl | 8 ++++++++ 3 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 templates/email/accountapproved.xml.tpl diff --git a/admin/usergroup.php b/admin/usergroup.php index 279c4a7..d01fd91 100755 --- a/admin/usergroup.php +++ b/admin/usergroup.php @@ -323,25 +323,22 @@ if ($_POST['do'] == 'doapprove') } } + // load the template system... + $bugsys->load('template_fs', 'template', true); + $template->setExtension('tpl'); + $template->setTemplateDir('templates/'); + $template->setDatabaseCache(TABLE_PREFIX . 'template'); + if (sizeof($idlist) > 0) { $users = $db->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid IN (" . implode(',', $idlist) . ")"); - - $mail->set('subject', sprintf(_('Account Approved at %1$s'), $bugsys->options['trackertitle'])); while ($user = $db->fetch_array($users)) { - $mail->to = array(); - $mail->to_add($user['displayname'], $user['email']); - $mail->set('bodytext', sprintf(_('Hi %1$s, - -Your account was awaiting moderation at %2$s. Today, an administrator approved your registration and you are now able to use the bug tracker fully. - -If you have any questions, please don\'t hesitate to contact the webmaster.'), - $user['displayname'], - $bugsys->options['trackertitle'] - )); - - $mail->send(); + eval('$email = "' . $template->fetch('email/accountapproved.xml') . '";'); + $email = $bugsys->xml->parse($email); + $mail->setSubject($email['email']['subject']['value']); + $mail->setBodyText($email['email']['bodyText']['value']); + $mail->send($user['email'], $user['displayname']); } $db->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = 2 WHERE userid IN (" . implode(',', $idlist) . ")"); diff --git a/docs/changes.txt b/docs/changes.txt index 7ed935b..1bda0f1 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -18,6 +18,7 @@ - Enahncement: Usergroups can be cloned to allow fast duplication of permissions - Fixed: Even after calling UsergroupAPI::delete(), there would still be usergroup remnants in bugfieldpermission and permission tables - Fixed: The javascript cancel buttons wouldn't work due to a parse error +- Fixed: When approving users, the approval email would never be sent and a method not found error would be shown 1.2.0 Beta 1 =============================== diff --git a/templates/email/accountapproved.xml.tpl b/templates/email/accountapproved.xml.tpl new file mode 100644 index 0000000..d60908c --- /dev/null +++ b/templates/email/accountapproved.xml.tpl @@ -0,0 +1,8 @@ + + Account Approved at {$bugsys->options['trackertitle']} + Hi $user[displayname], + +Your account was awaiting moderation at {$bugsys->options['trackertitle']}. Today, an administrator approved your registration and you are now able to use the bug tracker fully. + +If you have any questions, please don't hesitate to contact the webmaster. + \ No newline at end of file -- 2.43.5