[Bast-commits] r9163 - in ironman/branches/mk-ii/IronMan-Web:
lib/IronMan/Web/Controller root
castaway at dev.catalyst.perl.org
castaway at dev.catalyst.perl.org
Wed Apr 14 21:13:58 GMT 2010
Author: castaway
Date: 2010-04-14 22:13:58 +0100 (Wed, 14 Apr 2010)
New Revision: 9163
Modified:
ironman/branches/mk-ii/IronMan-Web/lib/IronMan/Web/Controller/Root.pm
ironman/branches/mk-ii/IronMan-Web/root/new_feed.tt
Log:
Add recaptcha
Modified: ironman/branches/mk-ii/IronMan-Web/lib/IronMan/Web/Controller/Root.pm
===================================================================
--- ironman/branches/mk-ii/IronMan-Web/lib/IronMan/Web/Controller/Root.pm 2010-04-14 20:58:51 UTC (rev 9162)
+++ ironman/branches/mk-ii/IronMan-Web/lib/IronMan/Web/Controller/Root.pm 2010-04-14 21:13:58 UTC (rev 9163)
@@ -7,7 +7,7 @@
use Email::Valid;
use DateTime;
use XML::OPML;
-use base 'Catalyst::Controller';
+use base 'Catalyst::Controller::reCAPTCHA';
#
# Sets the actions in this controller to be registered with no prefix
@@ -71,6 +71,7 @@
my $title = $c->req->param('title');
$c->stash( params => $c->req->params);
+ $c->forward('captcha_get');
return 1 if(!%{ $c->req->params });
@@ -81,6 +82,11 @@
$c->stash( errors => $errors);
return 1;
}
+ if(!$c->forward('captcha_check')) {
+ $c->log->_dump($c->stash->{recaptcha_error});
+ $c->stash( errors => ['reCAPTCHA failed']);
+ return 1;
+ }
$c->log->debug("input ok");
Modified: ironman/branches/mk-ii/IronMan-Web/root/new_feed.tt
===================================================================
--- ironman/branches/mk-ii/IronMan-Web/root/new_feed.tt 2010-04-14 20:58:51 UTC (rev 9162)
+++ ironman/branches/mk-ii/IronMan-Web/root/new_feed.tt 2010-04-14 21:13:58 UTC (rev 9163)
@@ -18,5 +18,6 @@
<label>Your Name ("Firstname Lastname (nick)" prefered)<input type="text" name="title" value="[% params.title %]"></label><br>
<label>Email <input type="text" name="email" value="[% params.email %]"></label><br>
<label>Email (confirmation)<input type="text" name="email_2"></label><br>
+ [% recaptcha %]
<input type="submit" value="Sign up">
</form>
More information about the Bast-commits
mailing list