Reply to comment

Fixing osDate captcha

Mon, 03/30/2009 - 22:20 - peter | |

If you've installed osDate, one of the first things you notice is that the captcha is very difficult to read.  It's simply overkill.  This stops bots from signing up, but it also stops many users.  The captcha should be made much easier.  Luckily, it's easy to fix the problem.

Open the file captcha/SecurityImage.php and make the following changes (feel free to make your own modifications as well, but if so test extensively).  

At line 23, change the array of allowable characters to include only the easily-distinguishable characters:

$chars = array ("A", "B", "C", "D", "E", "K", "M", "P", "T", "W", "4", "X") ;

At line 34, change the defaults for the captcha length and font size:

$this->strLength = 4 ;
$this->fontsize = 24;
$this->num_dots = 100;

At line 80, change the spacing of the letters:

$this->writeLetter($this->text[$i],(20 + $i * 30));

At line 110, change the vertical placement:

$yvalue = 35 - mt_rand(0, 10);
$angle = mt_rand(-10,10);

With these modified settings, your users will now actually be able to read the capcha characters and be able to sign up.

Reply

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for clevery testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.