Tutorials » Signup ReCaptcha for SocialEngine V4

Signup ReCaptcha for SocialEngine V4

This modification allows replacing the signup captcha image verification with ReCaptcha

BEFORE


AFTER

Disclaimer: This tutorial is provided as is. No official support is provided, you can ask questions on our community forum. This tutorial is copyright socialenginemods.net. Any distribution of the tutorial without prior permission is prohibited.


Instructions


1 Register your site and get the ReCaptcha Keys https://www.google.com/recaptcha/admin/create

You will get Public Key and Private Key


2 Open application/modules/User/Form/Signup/Account.php and find: (around line 232)

	// Init captcha
	if (Engine_Api::_()->getApi('settings', 'core')->core_spam_signup) {
	  $this->addElement('captcha', 'captcha', array(
		'description' => '_CAPTCHA_DESCRIPTION',
		'captcha' => 'image',
		'required' => true,
		'allowEmpty' => false,
		'captchaOptions' => array(
		  'wordLen' => 6,
		  'fontSize' => '30',
		  'timeout' => 300,
		  'imgDir' => APPLICATION_PATH . '/public/temporary/',
		  'imgUrl' => $this->getView()->baseUrl().'/public/temporary',
		  'font' => APPLICATION_PATH . '/application/modules/Core/externals/fonts/arial.ttf'
		)));
	}
			

replace with

	// Init captcha
	if (Engine_Api::_()->getApi('settings', 'core')->core_spam_signup) {
	  $this->addElement('captcha', 'captcha', array(
		'description' => '_CAPTCHA_DESCRIPTION',
		'captcha' => 'reCaptcha',
		'required' => true,
		'allowEmpty' => false,
		'captchaOptions' => array(
		  'pubKey' => 'Your Public Key',
		  'privKey' => 'Your Private Key',		
		  'wordLen' => 6,
		  'fontSize' => '30',
		  'timeout' => 300,
		  'imgDir' => APPLICATION_PATH . '/public/temporary/',
		  'imgUrl' => $this->getView()->baseUrl().'/public/temporary',
		  'font' => APPLICATION_PATH . '/application/modules/Core/externals/fonts/arial.ttf'
		)));
	}
			


That's it!