Skip to content
Permalink
Browse files

Upgrade to new version of ReCaptcha library. (#894)

  • Loading branch information...
demiankatz committed Jan 25, 2017
1 parent 1c16206 commit c44a44e87d452cc0d2d0e404489fd7a63749d799
@@ -12,7 +12,7 @@
"aferrandini/phpqrcode": "1.0.1",
"jasig/phpcas": "1.3.3",
"cap60552/php-sip2": "1.0.0",
"los/losrecaptcha": "1.0.0",
"los/losrecaptcha": "2.0.2",
"ahand/mobileesp": "dev-master",
"matthiasmullie/minify": "1.3.35",
"ocramius/proxy-manager": "1.0.2",
@@ -124,7 +124,7 @@ public function validate()
} catch (\ZendService\ReCaptcha\Exception $e) {
$response = false;
}
$captchaPassed = $response && $response->isValid();
$captchaPassed = $response && $response->isSuccess();
if (!$captchaPassed && $this->errorMode != 'none') {
if ($this->errorMode == 'flash') {
$this->getController()->flashMessenger()
@@ -540,17 +540,18 @@ public static function getRecaptcha(ServiceManager $sm)
: (isset($config->Captcha->privateKey)
? $config->Captcha->privateKey
: '');
$recaptcha = new \VuFind\Service\ReCaptcha(
$siteKey, $secretKey, ['ssl' => true]
);
$httpClient = $sm->get('VuFind\Http')->createClient();
$translator = $sm->get('VuFind\Translator');
$options = ['lang' => $translator->getLocale()];
if (isset($config->Captcha->theme)) {
$recaptcha->setOption('theme', $config->Captcha->theme);
$options['theme'] = $config->Captcha->theme;
}
$translator = $sm->get('VuFind\Translator');
$recaptcha->setOption('lang', $translator->getLocale());
$recaptcha = new \VuFind\Service\ReCaptcha(
$siteKey, $secretKey,
new \LosReCaptcha\Service\Request\ZendHttpClient($httpClient),
['ssl' => true], $options
);
$httpClient = $sm->get('VuFind\Http')->createClient();
$recaptcha->setHttpClient($httpClient);
return $recaptcha;
}
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category VuFind
* @package View_Helpers
* @package Service
* @author Chris Hallberg <crhallberg@gmail.com>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development Wiki

0 comments on commit c44a44e

Please sign in to comment.
You can’t perform that action at this time.