xoops forums

irmtfan

Module Developer
Posted on: 2013/4/15 8:44
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#1

Local Math Captcha Hack (to provide more protection against spams)

Local Math Captcha Hack - irmtfan - www.xoops.org - www.xoops.ir
===========================
This is a very simple hack to change the XOOPS math captcha from figures to local words to provide more protection against spams.
Example: {3} + {4} = ? will be changed to {three} + {four} = ? in english
This hack had been introduced about one year ago in XOOPS255 persian release and was completely effective in persian websites. eg: I had not one single spam in my website for more than a year while previously I had 5 or 6 daily spams.
I hope this hack will be useful in other local communities and even english websites.
Please try it and report the result in xoops.org forums.

Install
--------------------------
Just copy 2 files in this package
1- ./htdocs/class/captcha/text.php

2- ./htdocs/language/english/locale.php

Note:
--------------------------
In XOOPS255 the captcha is set to "image" by default. You should change the captcha mode to "text" in XOOPS255/class/captcha/config.php
'mode' => 'text',  // default mode, you can choose 'text', 'image', 'recaptcha'(requires api key)


You can back to old figures by changing the setting in ./htdocs/language/english/locale.php
define("_NUM_TYPE","word"); // you can choose "figure","word","image"

]

Translation:
----------------
You can implement this hack for your own language by:
1- Copying ./htdocs/language/english/locale.php into ./htdocs/language/YOUR_LANG/locale.php
2- Translate figures to your own language (currently you only need to translate 1-9):
$_numWords = array(    '0'=> '' ,
                    
'1'=> 'one' ,
                    
'2'=> 'two' ,
                    
'3' => 'three',
                    
'4' => 'four',
                    
'5' => 'five',
                    
'6' => 'six',
                    
'7' => 'seven',
                    
'8' => 'eight',
                    
'9' => 'nine',
                    
'10' => 'ten',
                    
'11' => 'eleven',
                    
'12' => 'twelve',
                    
'13' => 'thirteen',
                    
'14' => 'fouteen',
                    
'15' => 'fifteen',
                    
'16' => 'sixteen',
                    
'17' => 'seventeen',
                    
'18' => 'eighteen',
                    
'19' => 'nineteen',
                    
'20' => 'twenty',
                    
'30' => 'thirty',
                    
'40' => 'fourty',
                    
'50' => 'fifty',
                    
'60' => 'sixty',
                    
'70' => 'seventy',
                    
'80' => 'eighty',
                    
'90' => 'ninty',
                    
'100' => 'hundred &',
                    
'1000' => 'thousand &',
                    
'1000000' => 'million',
                    
'1000000000' => 'billion');


TO DO:
---------------------
show numbers as figure images.

Download:
---------------------
www.jadoogaran.org/test255/loc ... _captcha_hack_255_256.zip

Alen

Just popping in
Posted on: 2014/9/11 10:03
Alen
Alen (Show more)
Just popping in
Posts: 3
Since: 2012/4/15
#2

Re: Local Math Captcha Hack (to provide more protection against spams)

excuse me!
Where can download the ocal Math Captcha Hack files?

The requested URL /test255/local_math_captcha_hack_255_256.zip was not found on this server.

thanks

Cifug

Quite a regular
Posted on: 2014/9/17 7:55
Cifug
Cifug (Show more)
Quite a regular
Posts: 208
Since: 2007/12/13
#3

Re: Local Math Captcha Hack (to provide more protection against spams)

Nice, just found this because of Alen's bump.

Thanks irmtfan

Cheers,
Marty