fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2012-01-06 09:15 am

[dw-free] Username reminder email in htdocs/lostinfo.bml not stripped

[commit: http://hg.dwscoalition.org/dw-free/rev/dcfd05b0cdb3]

http://bugs.dwscoalition.org/show_bug.cgi?id=4078

Strip username reminder email.

Patch by [personal profile] ninetydegrees.

Files modified:
  • htdocs/lostinfo.bml
  • htdocs/lostinfo.bml.text
--------------------------------------------------------------------------------
diff -r ae95ffb56e68 -r dcfd05b0cdb3 htdocs/lostinfo.bml
--- a/htdocs/lostinfo.bml	Fri Jan 06 17:14:32 2012 +0800
+++ b/htdocs/lostinfo.bml	Fri Jan 06 17:16:19 2012 +0800
@@ -200,21 +200,23 @@
 
         # we have valid usernames, build email body
         my $body;
-        $body .= "This is your requested username reminder from $LJ::SITENAME.  ";
-        $body .= "Below are the usernames you have registered for the email address $email:\n\n";
+        my $userlist = join "\n          ", @users;
+        my $ip = BML::get_remote_host() . "(" . BML::get_remote_ip() . ")";
 
-        $body .= "          $_\n" foreach @users;
-
-        $body .= "\nThis information was requested on the website from " . BML::get_remote_host() .
-                 " (" . BML::get_remote_ip() . ").\n\n";
-        $body .= "Regards,\n$LJ::SITENAME Team\n\n$LJ::SITEROOT/\n";
+        $body = LJ::Lang::ml( ".email.body", {
+                sitename => $LJ::SITENAME,
+                emailaddress  => $email,
+                usernames => $userlist,
+                remoteip => $ip,
+                siteurl => $LJ::SITEROOT
+            } );
 
         LJ::send_mail({
             'to' => $email,
             'from' => $LJ::ADMIN_EMAIL,
             'fromname' => $LJ::SITENAME,
             'charset' => 'utf-8',
-            'subject' => "Lost Username",
+            'subject' => LJ::Lang::ml( ".email.subject" ),
             'body' => $body,
         }) or die "Error: couldn't send email";
 
diff -r ae95ffb56e68 -r dcfd05b0cdb3 htdocs/lostinfo.bml.text
--- a/htdocs/lostinfo.bml.text	Fri Jan 06 17:14:32 2012 +0800
+++ b/htdocs/lostinfo.bml.text	Fri Jan 06 17:16:19 2012 +0800
@@ -1,6 +1,23 @@
 ;; -*- coding: utf-8 -*-
 .btn.proceed=Proceed
 
+.email.body<<
+
+This is your requested username reminder from [[sitename]]. Below are the usernames you have registered for the email address [[emailaddress]]:
+
+          [[usernames]]
+
+This information was requested on the website from [[remoteip]].
+
+Regards,
+[[sitename]] Team
+
+[[siteurl]]
+
+.
+
+.email.subject=Lost Username
+
 .enter_email=Enter your email address:
 
 .enter_email_optional=Email address:  (optional)
--------------------------------------------------------------------------------