SocialEngine 4: SSL Captcha

Do you run a SSL Site but are unable to use Google Captcha due to data not being sent over SSL, while knowing you can use Google Captcha with SSL?

Open : \application\modules\Core\controllers\AdminSettingsController.php

Edit this line in section 223:

// Validate public key<br /><%%KEEPWHITESPACE%%>        $httpClient = new Zend_Http_Client();<br /><%%KEEPWHITESPACE%%>        $httpClient->setUri('https://www.google.com/recaptcha/api/challenge');<br /><%%KEEPWHITESPACE%%>        $httpClient->setParameterGet('k', $values['recaptchapublic']);<br /><%%KEEPWHITESPACE%%>        $resp = $httpClient->request('GET');<br /><%%KEEPWHITESPACE%%>        if( false !== stripos($resp->getBody(), 'Input error') ) {<br /><%%KEEPWHITESPACE%%>          return $form->addError('ReCaptcha Error: ' . str_replace(array("document.write('", "\\n');"), array('', ''), $resp->getBody()));<br /><%%KEEPWHITESPACE%%>        }<br /><%%KEEPWHITESPACE%%>      } catch( Exception $e ) {<br /><%%KEEPWHITESPACE%%>        return $form->addError('ReCaptcha Key Invalid: ' . $e->getMessage());<br /><%%KEEPWHITESPACE%%>      }

You should see your selection look like this after:

// Validate public key<br /><%%KEEPWHITESPACE%%>        $httpClient = new Zend_Http_Client();<br /><%%KEEPWHITESPACE%%>        $httpClient->setUri('https://www.google.com/recaptcha/api/challenge');<br /><%%KEEPWHITESPACE%%>        $httpClient->setParameterGet('k', $values['recaptchapublic']);<br /><%%KEEPWHITESPACE%%>        $resp = $httpClient->request('GET');<br /><%%KEEPWHITESPACE%%>        if( false !== stripos($resp->getBody(), 'Input error') ) {<br /><%%KEEPWHITESPACE%%>          return $form->addError('ReCaptcha Error: ' . str_replace(array("document.write('", "\\n');"), array('', ''), $resp->getBody()));<br /><%%KEEPWHITESPACE%%>        }<br /><%%KEEPWHITESPACE%%>      } catch( Exception $e ) {<br /><%%KEEPWHITESPACE%%>        return $form->addError('ReCaptcha Key Invalid: ' . $e->getMessage());<br /><%%KEEPWHITESPACE%%>      }

Please make a backup of your site and file before attempting this as I have not been able to test myself as I do not use SSL Sites right now.

Looking for quality Social Engine Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , | Posted under SocialEngine | RSS 2.0

Author Spotlight

Andrew Cross

Andrew Cross

Hi, I'm Andrew. A am a 26, ICT Administrator which offers support to company's around the South Wales Area. I have created a few social sites for myself and other company's. So far 2 out of 3 have been successful using the powerful SocialEngine Script. I continue to try and help the community of SocialEngine by giving Support and Technical Help where possible.

Leave a Reply

Your email address will not be published. Required fields are marked *


6 × = 12

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>