The contact form did not use the name specified. Corrected.
authorTimm S. Mueller <tmueller@neoscientists.org>
Sun, 21 Feb 2010 12:55:27 +0100
changeset 257058f96953252
parent 256 8cd1538fbd18
child 258 30e3e6d34685
The contact form did not use the name specified. Corrected.
extensions/contactform.lua
locale/de
locale/en
     1.1 --- a/extensions/contactform.lua	Sun Feb 21 01:14:21 2010 +0100
     1.2 +++ b/extensions/contactform.lua	Sun Feb 21 12:55:27 2010 +0100
     1.3 @@ -25,15 +25,22 @@
     1.4  			body = body:sub(1, 2000):gsub("\r", "")
     1.5  			phone = purify(phone or "", 80)
     1.6  			prefix = prefix and prefix .. " " or ""
     1.7 +			if name and name ~= "" then
     1.8 +				fromadr = ("%s <%s>"):format(name, fromadr)
     1.9 +			end
    1.10  			local f = io.popen("sendmail -t", "w")
    1.11  			if f then
    1.12  				f:write("Content-Type: text/plain; charset=UTF-8\n")
    1.13  				f:write("Reply-To: ", fromadr, "\n")
    1.14  				f:write("To: ", toadr, "\n")
    1.15  				f:write("Subject: ", prefix, subject, "\n\n")
    1.16 +				
    1.17 +				f:write(loona.locale.CONTACTFORM_FROM, ": ", fromadr, "\n")
    1.18  				if phone ~= "" then
    1.19 -					f:write("Phone-Number: ", phone, "\n\n")
    1.20 +					f:write(loona.locale.CONTACTFORM_PHON, ": ", phone, "\n")
    1.21  				end
    1.22 +				f:write("\n")
    1.23 +				
    1.24  				f:write(body)
    1.25  				return 1 -- success
    1.26  			end
     2.1 --- a/locale/de	Sun Feb 21 01:14:21 2010 +0100
     2.2 +++ b/locale/de	Sun Feb 21 12:55:27 2010 +0100
     2.3 @@ -56,6 +56,7 @@
     2.4  SECTION_IS_REDIRECT = "Diese Sektion leitet den Benutzer weiter nach",
     2.5  CONFIRMATION = "Best├Ątigung",
     2.6  CONTACTFORM_FORM = "Kontaktformular",
     2.7 +CONTACTFORM_FROM = "Von",
     2.8  CONTACTFORM_NAME = "Name",
     2.9  CONTACTFORM_ADDR = "Ihre e-Mail-Adresse",
    2.10  CONTACTFORM_SUBJ = "Betreff",
     3.1 --- a/locale/en	Sun Feb 21 01:14:21 2010 +0100
     3.2 +++ b/locale/en	Sun Feb 21 12:55:27 2010 +0100
     3.3 @@ -56,6 +56,7 @@
     3.4  SECTION_IS_REDIRECT = "This section redirects the user to",
     3.5  CONFIRMATION = "Confirmation",
     3.6  CONTACTFORM_FORM = "Contact form",
     3.7 +CONTACTFORM_FROM = "From",
     3.8  CONTACTFORM_NAME = "Name",
     3.9  CONTACTFORM_ADDR = "Your e-Mail address",
    3.10  CONTACTFORM_SUBJ = "Subject",