Egg::Plugin::Authen::Captcha - Plugin for Authen::Captcha.


Egg-Plugin-Authen-Captcha documentation Contained in the Egg-Plugin-Authen-Captcha distribution.

Index


Code Index:

NAME

Top

Egg::Plugin::Authen::Captcha - Plugin for Authen::Captcha.

SYNOPSIS

Top

  use Egg qw/ Authen::Captcha /;

  # The validation code is obtained.
  my $md5hex= $e->authc->generate_code(5);

  # It preserves it in the session.
  $e->session->{authen_capcha}= $md5hex;

  # The attestation image is displayed.
  <img src="/authen_captcha/<% $md5hex %>.png" />

  # Check on input code
  my $in= $e->req->param('auth_code') || return 'I want input of auth_code.';
  $in eq $e->session->{authen_capcha} || return 'auth_code is not corresponding.';

DESCRIPTION

Top

It is a plug-in to attest capture.

see Authen::Captcha.

CONFIGURATION

Top

Please set it with the key named 'plugin_authen_captcha'.

  plugin_authen_captcha => {
    data_folder   => '<e.dir.etc>/AuthCaptcha',
    output_folder => '<e.dir.static>/AuthCaptcha',
    width         => 30,
    height        => 40,
    },

All set values are passed by the constructor of Authen::Captcha.

see Authen::Captcha.

METHODS

Top

authc

Authen::Captcha object is returned.

  my $ac= $e->authc;

SEE ALSO

Top

Authen::Captcha, Class::Data::Inheritable, Egg::Release,

AUTHOR

Top

Masatoshi Mizuno <lushe&64;cpan.org>

COPYRIGHT AND LICENSE

Top


Egg-Plugin-Authen-Captcha documentation Contained in the Egg-Plugin-Authen-Captcha distribution.

package Egg::Plugin::Authen::Captcha;
#
# Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt>
#
# $Id: Captcha.pm 317 2008-04-17 11:58:43Z lushe $
#
use strict;
use warnings;
use Authen::Captcha;
use base qw/ Class::Data::Inheritable /;

our $VERSION = '0.03';

__PACKAGE__->mk_classdata('authc');

sub _setup {
	my($e)= @_;
	my $option= $e->config->{plugin_authen_captcha} ||= {};
	__PACKAGE__->authc( Authen::Captcha->new(%$option) );
	$e->next::method;
}

1;

__END__