leedaekyu / kaptcha

Automatically exported from code.google.com/p/kaptcha
Other
0 stars 0 forks source link

Some souce code changes which fit my needs, hope useful for Kaptcha #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I learned Kaptcha from the simplecaptcha project which seems suspended. The
Kaptach project is useful for my project, however there are some features I
need but Kaptcha doesn't provides:
1. I need smaller Kaptcha image for my project, but the size is not
configable in Kaptcha.
2. I prefer no noise but the DefaultNoise is at least used.
3. Sometimes there will be multiple Kaptcha images on one same page, but
the session key KAPTCHA_SESSION_KEY can only be used for one image.

So I changed source code:
For feature 1:
    a. Added two new configuration parameters "kaptcha.width" and
"kaptcha.height" in Constants and Config
    b. Changed DefaultWordRenderer to suit resizeable image.
    c. Changed DefaultKaptcha to adjust the image size from configuration
parameters.
For feature 2:
    I created a new Noise implementaion called NoNoise, which does nothing for
making noise.

For feature 3:
    a. Changed KaptchaServlet to allow customizable Session attribute for
Kaptcha image. User can specify url parameter "?userSessionKey=xxxxxx" to
provide user customized Session key, KaptchaServlet will check this url
parameter, if not specified, use default Session key KAPTCHA_SESSION_KEY,
otherwise, use user specified keys xxxxxx.

I hope there are something useful for the Kaptcha project. So I submit the
changed source code here.

Original issue reported on code.google.com by ubunt...@gmail.com on 19 Apr 2008 at 10:00

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you for your patches, I'll take a look at them soon.

Original comment by latch...@gmail.com on 29 Apr 2008 at 12:03

GoogleCodeExporter commented 8 years ago
Thank you for the changes. I've committed everything but #3. I changed that to 
allow it to be configurable via 
the web.xml instead. Something just seems wrong with allowing someone to do 
that via a param... allowing that 
opens yourself up to all sorts of attacks.

Original comment by latch...@gmail.com on 11 Jun 2008 at 3:02

GoogleCodeExporter commented 8 years ago

Original comment by latch...@gmail.com on 11 Jun 2008 at 4:08