diff --git a/application/classes/hooks/HookMain.class.php b/application/classes/hooks/HookMain.class.php index ff911ed7..da7529ed 100644 --- a/application/classes/hooks/HookMain.class.php +++ b/application/classes/hooks/HookMain.class.php @@ -47,9 +47,15 @@ class HookMain extends Hook if (!$oUserCurrent and Config::Get('general.close') and !Router::CheckIsCurrentAction((array)Config::Get('general.close_exceptions'))) { Router::Action('login'); } + $this->LoadDefaultJsVar(); /** * Запуск обработки сборщика */ $this->Ls_SenderRun(); } + + public function LoadDefaultJsVar() + { + $this->Viewer_AssignJs('recaptcha.site_key', Config::Get('module.validate.recaptcha.site_key')); + } } \ No newline at end of file diff --git a/application/config/config.php b/application/config/config.php index 18e69358..b29a7a97 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -268,6 +268,15 @@ $config['module']['media']['image']['preview']['sizes'] = array( // списо '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'); @@ -491,6 +500,7 @@ $config['head']['default']['js'] = array( //"___path.skin.web___/components/ls-vendor/jquery.placeholder.min.js" => array('browser' => 'lt IE 9'), "//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(); diff --git a/application/frontend/skin/developer/assets/js/init.js b/application/frontend/skin/developer/assets/js/init.js index f651648a..6107bb9a 100644 --- a/application/frontend/skin/developer/assets/js/init.js +++ b/application/frontend/skin/developer/assets/js/init.js @@ -87,6 +87,11 @@ jQuery(document).ready(function($){ $(this).lsCaptcha(); }); + $('[data-type=recaptcha]').livequery(function () { + $(this).lsReCaptcha({ + key: ls.registry.get('recaptcha.site_key') + }); + }); /** * Alerts diff --git a/framework b/framework index 1cca764a..59351076 160000 --- a/framework +++ b/framework @@ -1 +1 @@ -Subproject commit 1cca764a40ffc8ea86badf16934b2438de453e9e +Subproject commit 5935107655b89ea78271a92e583c101a79a71e45