Sledge::Plugin::Captcha - create and validate Captcha for Sledge.
package Your::Pages; use base qw/Sledge::Pages::Compat/; use Sledge::Plugin::ShowImage; use Sledge::Plugin::Captcha; sub dispatch_show_captcha { my ($self, ) = @_; $self->create_captcha; } sub valid_post { my ($self, ) = @_; unless ($self->validate_captcha($self->r->param('captcha'))) { $self->valid->set_error(CAPTCHA_ERROR => 'captcha'); } } # config.yaml common: captcha: new: width: 180 height: 30 lines: 5 gd_font: giant create: - normal - ec particle: - 100 session_name: captcha_string out: force: jpeg
This plugin create, validate Captcha.
Note: This plugin uses GD::SecurityImage
Create Captcha image and output it.
$c->validate_captcha($key);
validate key
Return a string for validation which is stored in session.
Clear a string which is stored in session.
The keyword for storing captcha string
These parameters are passed to each GD::Security's method. Please see GD::SecurityImage for details.
Tokuhiro Matsuno <tokuhiro __at__ mobilefactory.jp>
<tokuhiro __at__ mobilefactory.jp>
Masahiro Nagano
Catalyst::Plugin::Captcha
Copyright (c) 2007, Tokuhiro Matsuno <tokuhiro __at__ mobilefactory.jp>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
To install Sledge::Plugin::Captcha, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sledge::Plugin::Captcha
CPAN shell
perl -MCPAN -e shell install Sledge::Plugin::Captcha
For more information on module installation, please visit the detailed CPAN module installation guide.