Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » Plug-in: zem_contact_reborn

#631 2006-11-18 09:58:08

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

jstubbs, which anti-spam plugin do you have installed? That’s one of the few parts in ZCR that I didn’t touch ;)

Matthew, you’ll get the ‘already submitted’ error in two situations:
  • if you fill out a form, press submit, and then reload the page (causing the same info to be submitted again).
  • if you go back one page after submitting a form, change the things you’ve entered and then submit again.

ZCR .17 would have given a ‘form expired’ message in those situations…. if its nonce detection had worked (it was broken).

ZCR can also give a ‘form expired’ error, but only if you take more than 10 minutes to fill out a form.
The difference with ‘already submitted’ is that the latter clears the form fields to avoid people from submitting the same thing over and over again quickly (‘form expired’ leaves the form input intact, because it hasn’t been submitted yet, you just have to press ‘submit’ once more… serves as an anti-spam feature).

Last edited by ruud (2006-11-19 23:26:51)

Offline

#632 2006-11-18 14:01:33

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Plug-in: zem_contact_reborn

Hi Ruud,

Just tried the form again, and got an “this form expired” error. This after closing the browser and going back several hours later. Cleared the cache too, just in case.

Pressed submit again, and got the nice “we do not accept spam thank you” messsages.

ZCR test, ZCR contact_lang test, pap_contact_cleaner version 0.1.

Offline

#633 2006-11-18 14:19:32

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

jstubbs, a few questions:
  • does your form have input fields called ‘phone’ or ‘mail’?
  • do you have a caching plugin installed?
  • can you provide an URL where you have a form that has these problems?

Last edited by ruud (2006-11-19 23:26:37)

Offline

#634 2006-11-18 14:21:12

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Plug-in: zem_contact_reborn

Ruud,

Just emailed your the URL for the form. No, I don’t have any caching plugins at all.

Offline

#635 2006-11-19 23:24:53

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

Some things needed fixing:
  • ‘name’ was missing from zem_contact_lang
  • TXP4.0.4 sending last modified headers really doesn’t mix well with the nonce system (that caused jstubbs’ problems), so the plugin now tries to fix that by sending a too old last-modified header itself which overrides the one that TXP sends. It also sets a 10 minute expiration date on the page, so it shouldn’t stay cached too long.
  • The ‘form already used’ error occurred too often. Solved by re-using the same nonce if possible and only marking it as used when ZCR actually sends an email. And if multiple forms are on a single page, each form gets its own nonce.
  • To support multiple forms on a single page some IDs had to be changed to classes.

Those who like to test, can grab a copy here:
zem_contact_reborn
zem_contact_lang

See page 62 of this topic for the list of bugs that were already fixed in the previous test version.

PS. this version works in both 4.0.3 and 4.0.4

Last edited by ruud (2006-11-26 21:35:40)

Offline

#636 2006-11-20 00:01:43

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,664
Website

Re: Plug-in: zem_contact_reborn

Updated, and at my first test, I ran into the ‘The form has expired, please try again’. Force reload, and at the second pass I could send the form. Not sure if that is because I ran too many tests yesterday with your test 2 version or what… (the form is on my website in the sidebar here, follow the contact link).

Hmm, just did a second test, and ran again into the ‘The form has expired, please try again’, error page. I had left one (required) field blank. Filled the missing field, and I could send.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#637 2006-11-20 00:34:01

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

Did those two tests occur within 10 minutes?
I couldn’t reproduce it on your website, so I suspect it was a cached page from a previous version.

Last edited by ruud (2006-11-20 00:38:05)

Offline

#638 2006-11-20 01:29:37

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,664
Website

Re: Plug-in: zem_contact_reborn

ruud wrote:

Did those two tests occur within 10 minutes?
I couldn’t reproduce it on your website, so I suspect it was a cached page from a previous version.

Hmm, I don’t think so. And I just tried again, had the same experience (with Camino, default browser, same as previous tests). Aggressive caching in Gecko?
But if I try with another browser (FX 2.0), no problems. As I didn’t used that one browser in the past two weeks, it didn’t have any cached file of course.

PS – did you actually send a message ? If so, I didn’t receive it.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#639 2006-11-20 08:06:52

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

I didn’t send any message. All the nonce checking (‘expired’ and ‘already used’ errors) happen before the form itself is parsed for valid content. What you could try in Camino is look at the HTML source, write down the nonce value. That should be different each time you visit the contact page. In Firefox, the only time this doesn’t happen is if I use the back button… and even that should not be possible for more than 10 minutes (page is set to expire after 10 minutes).

Offline

#640 2006-11-20 08:52:38

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,664
Website

Re: Plug-in: zem_contact_reborn

ruud wrote:

I didn’t send any message. All the nonce checking (‘expired’ and ‘already used’ errors) happen before the form itself is parsed for valid content. What you could try in Camino is look at the HTML source, write down the nonce value. That should be different each time you visit the contact page. In Firefox, the only time this doesn’t happen is if I use the back button… and even that should not be possible for more than 10 minutes (page is set to expire after 10 minutes).

Hmm, me thinks I need to make a quick visit to Bugzilla. Your comment somehow light a bulb about a little bug with caching I remember seeing recently (doesn’t affect the release build – Firefox 2.0, only recent trunk builds, my Camino build is never older than 24 hours).

——
That aside, this latest version seems to perform quite well.
One nitpick (really). The output in the email client contains double linebreaks between the [subject], [Name], [Email] lines (in that basic form of mines). Was that done on purpose ? I’d prefer to see one linebreak only.
Next on my to-do: test that code with non-roman text (Japanese). I had once written a longish post on the subject in this thread (can’t find it, right now, 60+ pages …).You might have seen it.

Thnaks for your hard work on this, btw.

Ah, I found it now: it is here.

Last edited by phiw13 (2006-11-20 08:58:06)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#641 2006-11-20 10:22:00

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

The double linebreak is to improve readability. If all form fields would fit on a single line, this would not be needed, but multiline form fields make it too hard to see the difference between form fields if there’s no blank line in between.

I’m very interested in the results of your TO-DO.
1. the subject is now mime-encoded if it contains non-us-ascii characters.
2. if the label is not a valid name/id, it is encoded (variation on base64 or md5) to make it valid.
3. this was a bug in TXP4.0.3 that treated all plugin code as ISO-8599-1 when displaying it in the edit window. Fixed in 4.0.4

Offline

#642 2006-11-20 13:03:09

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,664
Website

Re: Plug-in: zem_contact_reborn

ruud wrote:

I’m very interested in the results of your TO-DO.
[snip]

Ok, on a basic test, with a form in Japanese, everything works nicely. Subject in Japanese, Labels around the Japanese text, translated messages in zem_contact_lang.

Nice.

I’ve only tested this from Mac to Mac (4 browsers, 2 email clients), ‘cuz, you know, it is getting late here, right now.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#643 2006-11-20 16:35:18

hcgtv
Archived Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Plug-in: zem_contact_reborn

ruud,

I’d love to start testing this but I’m getting a bit lost following this thread.

How about starting a new thread, where you can update the first post whenever a new version comes out?

Thanks.

Offline

#644 2006-11-20 17:57:18

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

I’ll do that later tonight, when I’ve gathered a list of changes and things to watch out for when upgrading.

Offline

#645 2006-11-20 19:07:37

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

Offline

  1. Index
  2. » Archives
  3. » Plug-in: zem_contact_reborn

Board footer

Powered by FluxBB