Secure image capcha revisited
I found a nice script http://www.phpcaptcha.org/ for made form capcha named secureimage and add some code for have random background and font for the capcha image
Here are the class modification that I made on the class:
- Porting the class for use in php5
- Remove the define for images: SI_IMAGE_JPEG, SI_IMAGE_PNG, SI_IMAGE_GIF
- Add define for ttf font path SI_PATH_TTF_FONTS
- Add define for gd font path SI_PATH_GD_FONTS
- Add define for random background imagess path SI_PATH_BACKGROUND
- Add define for audio path SI_PATH_AUDIO
- Add define for wordlist path SI_PATH_WORDS
- Set static var for $charset
- Add var $automatic_random for enable / disable random font and background image
- Add var $lang_wordlist for have wordlist for any language
- Delete var $wordlist_file: the file now is on SI_PATH_WORDS.’wordlist-’.$lang_wordlist.’.txt’
- Add var $use_random_bg_image for set random extraction for the background image
- Modify var $gd_font_file: now can set only filename
- Modify var $gd_font_file: now can set only filename
- Modify var $audio_path: now can set only filename
- Add options array to the constructor function: $img = new Securimage(array(‘automatic_random’=>false,’lang_wordlist’=>’it’));
- Add generic function for set var in the class: (void)setOption($name, $value);
- Add generic function for set var in the class: (void)setBgImage(‘/path-to-my-bg-image/image-name.jpg’);
- Modify function show() and added the code for have random background and font in the class
- Added function getRandom() for charge random files

Hits : 30

