On 10 Jan 2011, at 07:10, Marc wrote:
> Hi,
>
> I seem to remember from somewhere that radius tags can't get access to
> session state, e.g. HTTP Headers. Specifically "Referer"? Is that
> correct? Just about to start digging into rails and would be nice to
> get hints where to look...
No, it's quite possible but can be slightly awkward in use.
Radius tags are implemented in the Page model, where you shouldn't have access
to the request, but it also defines request and response accessors that are
populated by the SiteController, so in a radius tag you can access the request
directly. The solid way would be:
referer = tag.globals.page.request.referer
but since we're rendering inside Page it's usually ok just to say:
referer = request.referer
The biggest problem you'll find is that in order to display request-specific
content you have to disable the page cache. If you just want to pick up
googlers you might find it easier to do in javascript.
> Also I'm was wondering if someone can provide pointers to how I can
> get at the form post before it is interpreted. I was looking at
> modifying the mailer extension to use obscured field names (part of
> getting http://nedbatchelder.com/text/stopbots.html techniques
> working).
I have an old fork of the Mailer that implements a honeypot mechanism quite
similar to what's described there but I think a bit less sophisticated. It may
show you where to start:
https://github.com/spanner/radiant-mailer-extension
best,
will