|
NAMEAuthen::Captcha - Perl extension for creating captcha's to verify the human element in transactions.SYNOPSISuse Authen::Captcha; # create a new object my $captcha = Authen::Captcha->new(); # set the data_folder. contains flatfile db to maintain state $captcha->data_folder('/some/folder'); # set directory to hold publicly accessible images $captcha->output_folder('/some/http/folder'); # Alternitively, any of the methods to set variables may also be # used directly in the constructor my $captcha = Authen::Captcha->new( data_folder => '/some/folder', output_folder => '/some/http/folder', ); # create a captcha. Image filename is "$token.png" my $token = $captcha->generate_code($number_of_characters); # check for a valid submitted captcha # $code is the submitted letter combination guess from the user # $token is the submitted token from the user (that we gave them) my $results = $captcha->check_code($code,$token); # $results will be one of: # 1 : Passed # 0 : Code not checked (file error) # -1 : Failed: code expired # -2 : Failed: invalid code (not in database) # -3 : Failed: invalid code (code does not match token) ############## WARNINGThe captcha produced by this module is rather weak compared to other modules available. You are advised to update to GD::SecurityImage, which provides API-compatible interface in GD::SecurityImage::AC module.ABSTRACTAuthen::Captcha provides an object oriented interface to captcha file creations. Captcha stands for Completely Automated Public Turing test to tell Computers and Humans Apart. A Captcha is a program that can generate and grade tests that:- most humans can pass. - current computer programs can't pass The most common form is an image file containing distorted text, which humans are adept at reading, and computers (generally) do a poor job. This module currently implements that method. We plan to add other methods, such as distorted sound files, and plain text riddles. REQUIRESGD (see http://search.cpan.org/~lds/GD-2.11/) Digest::MD5 (standard perl module) In most common situations, you'll also want to have: A web server (untested on windows, but it should work) cgi-bin or mod-perl access Perl: Perl 5.00503 or later must be installed on the web server. GD.pm (with PNG support) INSTALLATIONDownload the zipped tar file from:http://search.cpan.org/search?dist=Authen-Captcha Unzip the module as follows or use winzip: tar -zxvf Authen-Captcha-1.xxx.tar.gz The module can be installed using the standard Perl procedure: perl Makefile.PL make make test make install # you need to be root Windows users without a working "make" can get nmake from: ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe METHODSMAIN METHODS
data_folder => '/some/folder', # required output_folder => '/some/http/folder', # required expire => 300, # optional. default 300 width => 25, # optional. default 25 height => 35, # optional. default 35 images_folder => '/some/folder', # optional. default to lib dir keep_failures => 0, # optional, defaults to 0(false) debug => 0, # optional. default 0
ACCESSOR METHODS
TODOsound file captcha: Incorporating distorted sound file creation.SEE ALSOThe Captcha project: http://www.captcha.net/The origonal perl script this came from: http://www.firstproductions.com/cgi/ AUTHORSSeth T. Jackson, <sjackson@purifieddata.net>Josh I. Miller, <jmiller@purifieddata.net> First Productions, Inc. created the cgi-script distributed under the GPL which was used as the basis for this module. Much work has gone into making this more robust, and suitable for other applications, but much of the origonal code remains. Fixes were reported and contributed by various people, see Changes file for a complete list. COPYRIGHT AND LICENSECopyright 2003, First Productions, Inc. (FIRSTPRODUCTIONS HUMAN TEST 1.0)Copyright 2003 by Seth Jackson Copyright 2012 by Paolo Rossi, Lubomir Rintel, Chris Dunlop, Gert Schepens and Ernesto Hernández-Novich This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. (see license.txt). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA POD ERRORSHey! The above document had some coding errors, which are explained below:
Visit the GSP FreeBSD Man Page Interface. |