logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: RFC: CGI::Application::Plugin::CAPTCHA: msg#00135

lang.perl.modules.cgi-appplication

Subject: Re: RFC: CGI::Application::Plugin::CAPTCHA

> -----Original Message-----
> From: Michael Peters [mailto:mpeters@xxxxxxxxxxxxx]
> Sent: Thursday, August 25, 2005 6:56 PM
> To: Jason A. Crome
> Cc: cgiapp@xxxxxxxxxxxxxxxxx
> Subject: Re: [cgiapp] RFC: CGI::Application::Plugin::CAPTCHA
>
> [...]
>
> I wouldn't store the images at all. A good CAPTCHA should use an image
> only once. That would be a waste to store. Just send the
> image directly
> to the browser (with the cookie of course).
>
> [...]
>
> If create_captcha() simply returned the image to the browser then the
> user could do something like this in their HTML
>
> <img src="/my/app?rm=captcha">
>
> And put it where ever they want.

I second this idea suggested by Michael: the captcha should be generated
on-the-fly, by a dedicated run-mode which returns the image binary
content (and there's no need to store the generated image anywhere).

This is exactly what I always do in a very similar context, that is when
I have to generate /live/ charts (for example via GD::Graph) in my CA
applications.

As for the response headers, I have a /dedicated/ subclass (which
inherits from my application base class) which contains only the
run-modes which generate the graphics.
In this subclass, similarly to what suggested by Mark, I then simply
override cgiapp_postrun, this way:

sub cgiapp_postrun {
my $self = shift;
$self->header_props( -type => 'image/png' )
}

(change the image type according to the format you are returning of
course).
Since this subclass contains only run-modes which return images, no
further tests are required.

As for the check, I would then suggest to simply store the string,
unencrypted, in the (server side) session data, and then check against
it the string provided by the user.
Trying to avoid session management IMO only leads to greater
complications.

Finally, it could be useful to integrate such captcha plugin with
CAP::ValidateRM (a plugin of a plugin? :-)

Ciao,
Emanuele.


---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
krysalis.sandbo...    web.zope.zwiki/...    gnome.apps.gnum...    xfree86.newbie/...    editors.vim/200...    mozilla.enigmai...    boot-loaders.gr...    network.vnc.ult...    redhat.release....    java.geronimo.u...    os.netbsd.devel...    horde.wicked/20...    linux.lsb.discu...    ietf.ips/2005-0...    alsa.devel/2002...    user-groups.lin...    package-managem...    debian.devel.da...    security.cyrus....    video.gstreamer...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation