Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove tabs

  • Loading branch information...
commit ba50cf37c78b813b8009da5bae9617fcc73115b9 1 parent 6eb8441
@gshank authored
Showing with 25 additions and 25 deletions.
  1. +2 −2 xt/captcha2.t
  2. +23 −23 xt/lib/MyCatalystApp/Controller/Captcha.pm
View
4 xt/captcha2.t
@@ -24,11 +24,11 @@ use Test::More;
my @missing;
eval" use Test::WWW::Mechanize::Catalyst; ";
if($@){
- push @missing, "Test::WWW::Mechanize";
+ push @missing, "Test::WWW::Mechanize";
}
eval" use GD::SecurityImage; ";
if($@){
- push @missing, "GD::SecurityImage";
+ push @missing, "GD::SecurityImage";
}
if(@missing){
View
46 xt/lib/MyCatalystApp/Controller/Captcha.pm
@@ -28,12 +28,12 @@ sub index :Path :Args(0) {
my ( $self, $c ) = @_;
my $form = MyCatalystApp::Controller::Captcha::Form->new(
- ctx => $c,
+ ctx => $c,
);
if($form->process($c->req->params)){
- $c->res->body("verification succeeded");
- return;
+ $c->res->body("verification succeeded");
+ return;
}
$c->res->body($form->render);
}
@@ -45,19 +45,19 @@ returns the image belonging to the current captcha
=cut
sub test :Local{
- my ( $self, $c ) = @_;
- my $captcha = $c->session->{captcha};
- $c->res->content_type($captcha->{type});
- my $filename = "captcha." . $captcha->{type};
- $c->res->header('Content-Disposition', qq[attachment; filename=$filename]);
- $c->res->body($captcha->{image});
+ my ( $self, $c ) = @_;
+ my $captcha = $c->session->{captcha};
+ $c->res->content_type($captcha->{type});
+ my $filename = "captcha." . $captcha->{type};
+ $c->res->header('Content-Disposition', qq[attachment; filename=$filename]);
+ $c->res->body($captcha->{image});
}
sub get_rnd :Local{
- my ( $self, $c ) = @_;
- my $captcha = $c->session->{captcha};
- die "no captcha in session" unless $captcha;
- $c->res->body($captcha->{rnd});
+ my ( $self, $c ) = @_;
+ my $captcha = $c->session->{captcha};
+ die "no captcha in session" unless $captcha;
+ $c->res->body($captcha->{rnd});
}
=head1 AUTHOR
@@ -74,19 +74,19 @@ it under the same terms as Perl itself.
__PACKAGE__->meta->make_immutable;
{
- package MyCatalystApp::Controller::Captcha::Form;
+ package MyCatalystApp::Controller::Captcha::Form;
- use HTML::FormHandler::Moose;
- extends qw/HTML::FormHandler/;
- with qw/
- HTML::FormHandler::Render::Simple
- HTML::FormHandler::TraitFor::Captcha
- /;
+ use HTML::FormHandler::Moose;
+ extends qw/HTML::FormHandler/;
+ with qw/
+ HTML::FormHandler::Render::Simple
+ HTML::FormHandler::TraitFor::Captcha
+ /;
- has_field submit => ( type => "Submit" );
+ has_field submit => ( type => "Submit" );
- __PACKAGE__->meta->make_immutable;
- 1;
+ __PACKAGE__->meta->make_immutable;
+ 1;
}
1;
Please sign in to comment.
Something went wrong with that request. Please try again.