[TYPO3] Need Help on Enabling Captcha

typo3 at gcnpublishing.com typo3 at gcnpublishing.com
Mon Jun 30 16:12:55 CEST 2008


Hi Guys,

I downloaded and installed a captcha extension sr_freecap to use captcha
in my form. i have already inserted the code in the html template. Now the
manual says to do the below :

Class inclusion and instantiation
The tx_srfreecap_pi2 class may be used in any Typo3 frond end plugin.
Insert statements similar to the following in order to include it and
instantiate it your script:
if (t3lib_extMgm::isLoaded('sr_freecap') ) {
	require_once(t3lib_extMgm::extPath('sr_freecap').'pi2/class.tx_srfreecap_pi2.php');
	$this->freeCap = t3lib_div::makeInstance('tx_srfreecap_pi2');
}
Filling the CAPTCHA subpart marker
Insert statements similar to the following in order to fill the CAPTCHA
subpart marker:
if (is_object($this->freeCap)) {
	$markerArray = array_merge($markerArray, $this->freeCap->makeCaptcha());
} else {
	$subpartArray['###CAPTCHA_INSERT###'] = '';
}

Method makeCaptcha() returns a marker array with filled in values for
markers: ###SR_FREECAP_NOTICE###, ###SR_FREECAP_CANT_READ### and
###SR_FREECAP_IMAGE###.
Checking the input string against the CAPTCHA string
Insert statements similar to the following in order to validate the string
entered by the user in the CAPTCHA input field:
if (is_object($this->freeCap) &&
!$this->freeCap->checkWord($your-form-data['captcha_response'])) {
	do-something about-it
}

WHERE DO I MAKE THESE CHANGES? IS IT INSIDE THE TS SETUP?? OR DO I HAVE TO
MODIFY SOME OTHER FILE. PLEASE SUGGEST.

Thanks!

Sundeep



More information about the TYPO3-english mailing list