[Bast-commits] r9096 - in ironman/trunk/IronMan-Web:
lib/IronMan/Web/Controller root
castaway at dev.catalyst.perl.org
castaway at dev.catalyst.perl.org
Tue Apr 6 22:32:39 GMT 2010
Author: castaway
Date: 2010-04-06 23:32:39 +0100 (Tue, 06 Apr 2010)
New Revision: 9096
Modified:
ironman/trunk/IronMan-Web/lib/IronMan/Web/Controller/Root.pm
ironman/trunk/IronMan-Web/root/new_feed.tt
Log:
Add reCaptcha to ironman signup form (blast those spammers!)
Modified: ironman/trunk/IronMan-Web/lib/IronMan/Web/Controller/Root.pm
===================================================================
--- ironman/trunk/IronMan-Web/lib/IronMan/Web/Controller/Root.pm 2010-04-06 22:07:13 UTC (rev 9095)
+++ ironman/trunk/IronMan-Web/lib/IronMan/Web/Controller/Root.pm 2010-04-06 22:32:39 UTC (rev 9096)
@@ -5,7 +5,7 @@
use Data::UUID;
use IronMan::Feeds;
use Email::Valid;
-use base 'Catalyst::Controller';
+use base 'Catalyst::Controller::reCAPTCHA';
#
# Sets the actions in this controller to be registered with no prefix
@@ -46,6 +46,8 @@
$c->stash( params => $c->req->params);
+ $c->forward('captcha_get');
+
return 1 if(!%{ $c->req->params });
my $errors = [];
@@ -55,6 +57,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/trunk/IronMan-Web/root/new_feed.tt
===================================================================
--- ironman/trunk/IronMan-Web/root/new_feed.tt 2010-04-06 22:07:13 UTC (rev 9095)
+++ ironman/trunk/IronMan-Web/root/new_feed.tt 2010-04-06 22:32:39 UTC (rev 9096)
@@ -65,6 +65,7 @@
<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>
<hr />
More information about the Bast-commits
mailing list