*

marcam

  • ****
  • 267
Fixing osDate captcha
« on: February 22, 2013, 12:28:11 AM »
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.
osdate 2.5.4
Flashchat 4.7
php 5.2.7

Re: Fixing osDate captcha
« Reply #1 on: February 22, 2013, 08:35:34 AM »
Hi,

Would it be possible to get different colors for each chrs (letter/figure)?
Kind regards,

Jan Oppeneer
working on template for 2.6 and OsdatePDO

My sites under construction:

www.oudere-homo-mannen.com
www.homosenioren.com
www.hotdatingplanet.eu

Will be testing for Osdater.

*

wp180

  • **
  • 74
    • Punk-Noz.fr
Re: Fixing osDate captcha
« Reply #2 on: February 22, 2013, 09:39:29 PM »
Looks really good, thanks for this idea.

wp180
Osdate 2.6
PHP 5.4.21
MsSQL 5.1.72

*

marcam

  • ****
  • 267
Re: Fixing osDate captcha
« Reply #3 on: February 23, 2013, 03:44:02 PM »
hi oppeneer;

edit /captcha/SecurityImage.php and look for line 52.

$this->colour = ImageColorAllocate ($this->image, 0, 0, 0); // Black

Try changing the color there by changing the 0, 0, 0 to the R, G, B values.

but is for alls , i dont no is possible for each chrs ,

i check that  8)

Hi,

Would it be possible to get different colors for each chrs (letter/figure)?
« Last Edit: February 23, 2013, 04:02:51 PM by marcam »
osdate 2.5.4
Flashchat 4.7
php 5.2.7

Re: Fixing osDate captcha
« Reply #4 on: February 25, 2013, 01:10:43 AM »
Hi,

Thanks that is indeed all chrs. I played around with that one before. But I have seen a lot of pages with different colors for each chrs.
Kind regards,

Jan Oppeneer
working on template for 2.6 and OsdatePDO

My sites under construction:

www.oudere-homo-mannen.com
www.homosenioren.com
www.hotdatingplanet.eu

Will be testing for Osdater.

*

michelontour

  • *
  • 28
  • PerfectMatch.nu
    • PerfectMatch
Re: Fixing osDate captcha
« Reply #5 on: March 11, 2013, 03:48:18 PM »
PERFECT! Thank you!
OSDATE 2.5.4

Michelontour

Twitter @perfectmatchnu

*

marcam

  • ****
  • 267
Re: Fixing osDate captcha
« Reply #6 on: March 21, 2013, 12:56:11 AM »
i have now random color for all chars , next try random color for each chars
osdate 2.5.4
Flashchat 4.7
php 5.2.7