1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-01 05:55:02 +03:00

Поддержка ReCaptcha

This commit is contained in:
Mzhelskiy Maxim 2015-02-02 23:58:48 +07:00
parent d2cb5cb0b2
commit 85dc27f99d
4 changed files with 22 additions and 1 deletions

View file

@ -47,9 +47,15 @@ class HookMain extends Hook
if (!$oUserCurrent and Config::Get('general.close') and !Router::CheckIsCurrentAction((array)Config::Get('general.close_exceptions'))) { if (!$oUserCurrent and Config::Get('general.close') and !Router::CheckIsCurrentAction((array)Config::Get('general.close_exceptions'))) {
Router::Action('login'); Router::Action('login');
} }
$this->LoadDefaultJsVar();
/** /**
* Запуск обработки сборщика * Запуск обработки сборщика
*/ */
$this->Ls_SenderRun(); $this->Ls_SenderRun();
} }
public function LoadDefaultJsVar()
{
$this->Viewer_AssignJs('recaptcha.site_key', Config::Get('module.validate.recaptcha.site_key'));
}
} }

View file

@ -268,6 +268,15 @@ $config['module']['media']['image']['preview']['sizes'] = array( // списо
'crop' => true, 'crop' => true,
), ),
); );
/**
* Модуль Validate
*/
// Настройки Google рекаптчи - https://www.google.com/recaptcha/admin#createsite
$config['module']['validate']['recaptcha']= array(
'site_key' => '', // Ключ
'secret_key' => '', // Секретный ключ
'use_ip' => false, // Использовать при валидации IP адрес клиента
);
// Какие модули должны быть загружены на старте // Какие модули должны быть загружены на старте
$config['module']['autoLoad'] = array('Hook', 'Cache', 'Logger', 'Security', 'Session', 'Lang', 'Message', 'User'); $config['module']['autoLoad'] = array('Hook', 'Cache', 'Logger', 'Security', 'Session', 'Lang', 'Message', 'User');
@ -491,6 +500,7 @@ $config['head']['default']['js'] = array(
//"___path.skin.web___/components/ls-vendor/jquery.placeholder.min.js" => array('browser' => 'lt IE 9'), //"___path.skin.web___/components/ls-vendor/jquery.placeholder.min.js" => array('browser' => 'lt IE 9'),
"//yandex.st/share/share.js" => array('merge' => false), "//yandex.st/share/share.js" => array('merge' => false),
"https://www.google.com/recaptcha/api.js?onload=__do_nothing__&render=explicit" => array('merge' => false),
); );
$config['head']['default']['css'] = array(); $config['head']['default']['css'] = array();

View file

@ -87,6 +87,11 @@ jQuery(document).ready(function($){
$(this).lsCaptcha(); $(this).lsCaptcha();
}); });
$('[data-type=recaptcha]').livequery(function () {
$(this).lsReCaptcha({
key: ls.registry.get('recaptcha.site_key')
});
});
/** /**
* Alerts * Alerts

@ -1 +1 @@
Subproject commit 1cca764a40ffc8ea86badf16934b2438de453e9e Subproject commit 5935107655b89ea78271a92e583c101a79a71e45