Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Access to request headers from validator functions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Paul Dorman  
View profile  
 More options Apr 18 2011, 7:56 pm
From: Paul Dorman <paul.dor...@gmail.com>
Date: Mon, 18 Apr 2011 16:56:47 -0700 (PDT)
Local: Mon, Apr 18 2011 7:56 pm
Subject: Access to request headers from validator functions
Hi all, I have a simple form that includes a ReCaptcha field. To work
with ReCaptcha, the check function must be passed the remote-addr as
well as the challenge and response. I'm using defform to produce my
form, which is nice and simple, but I'm not sure how to aquire the
remote-address from the request headers in my validation function.
Could someone please describe how I might go about this?

Thanks in advance!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brenton  
View profile  
 More options Apr 19 2011, 12:48 am
From: Brenton <bashw...@gmail.com>
Date: Mon, 18 Apr 2011 21:48:19 -0700 (PDT)
Local: Tues, Apr 19 2011 12:48 am
Subject: Re: Access to request headers from validator functions
Paul,

Validators can only validate the data that is submitted with the form.
This means that you will need to submit the remote-addr as a hidden
form field.

Here is how you would do this:

https://gist.github.com/926824

As shown in the code above, the form defaults can be a map or a
function of the request.

In a future version, the field list may also be a function of the
request. I may also consider that for validation.

Brenton

On Apr 18, 4:56 pm, Paul Dorman <paul.dor...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Dorman  
View profile  
 More options Apr 19 2011, 1:49 am
From: Paul Dorman <paul.dor...@gmail.com>
Date: Tue, 19 Apr 2011 17:49:00 +1200
Subject: Re: Access to request headers from validator functions

Thanks for that Brenton, I'll apply it to my code tonight. I'm embarrassed
to say that it didn't occur to me at all that defaults needn't be fields!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »