find ./*/public_html/stolbiki-parkovochnye -type f -name 'index.php' -exec sed -i 's/\x24GLOBALS\[\x22SLIDER_TOP\x22\] = 17258\x3B/$GLOBALS["PREIM_TOP"] = 3670;/g' {} \;
[ITEM_PRICES] => Array
(
[0] => Array
(
[UNROUND_BASE_PRICE] => 1279
[UNROUND_PRICE] => 1279
[BASE_PRICE] => 1279
[PRICE] => 1279
[ID] => 7135
[PRICE_TYPE_ID] => 1
[CURRENCY] => RUB
[DISCOUNT] => 0
[PERCENT] => 0
[QUANTITY_FROM] => 1
[QUANTITY_TO] => 50
[QUANTITY_HASH] => 1-50
[MEASURE_RATIO_ID] =>
[PRINT_BASE_PRICE] => 1 279 руб.
[RATIO_BASE_PRICE] => 1279
[PRINT_RATIO_BASE_PRICE] => 1 279 руб.
[PRINT_PRICE] => 1 279 руб.
[RATIO_PRICE] => 1279
[PRINT_RATIO_PRICE] => 1 279 руб.
[PRINT_DISCOUNT] => 0 руб.
[RATIO_DISCOUNT] => 0
[PRINT_RATIO_DISCOUNT] => 0 руб.
[MIN_QUANTITY] => 1
)
[1] => Array
(
[UNROUND_BASE_PRICE] => 1269
[UNROUND_PRICE] => 1269
[BASE_PRICE] => 1269
[PRICE] => 1269
[ID] => 10839
[PRICE_TYPE_ID] => 1
[CURRENCY] => RUB
[DISCOUNT] => 0
[PERCENT] => 0
[QUANTITY_FROM] => 51
[QUANTITY_TO] => 250
[QUANTITY_HASH] => 51-250
[MEASURE_RATIO_ID] =>
[PRINT_BASE_PRICE] => 1 269 руб.
[RATIO_BASE_PRICE] => 1269
[PRINT_RATIO_BASE_PRICE] => 1 269 руб.
[PRINT_PRICE] => 1 269 руб.
[RATIO_PRICE] => 1269
[PRINT_RATIO_PRICE] => 1 269 руб.
[PRINT_DISCOUNT] => 0 руб.
[RATIO_DISCOUNT] => 0
[PRINT_RATIO_DISCOUNT] => 0 руб.
[MIN_QUANTITY] => 51
)
[2] => Array
(
[UNROUND_BASE_PRICE] => 1259
[UNROUND_PRICE] => 1259
[BASE_PRICE] => 1259
[PRICE] => 1259
[ID] => 10840
[PRICE_TYPE_ID] => 1
[CURRENCY] => RUB
[DISCOUNT] => 0
[PERCENT] => 0
[QUANTITY_FROM] => 251
[QUANTITY_TO] =>
[QUANTITY_HASH] => 251-INF
[MEASURE_RATIO_ID] =>
[PRINT_BASE_PRICE] => 1 259 руб.
[RATIO_BASE_PRICE] => 1259
[PRINT_RATIO_BASE_PRICE] => 1 259 руб.
[PRINT_PRICE] => 1 259 руб.
[RATIO_PRICE] => 1259
[PRINT_RATIO_PRICE] => 1 259 руб.
[PRINT_DISCOUNT] => 0 руб.
[RATIO_DISCOUNT] => 0
[PRINT_RATIO_DISCOUNT] => 0 руб.
[MIN_QUANTITY] => 251
)
)
[osnova] => Array
(
[PRICE_ID] => 3
[ID] => 10853
[CAN_ACCESS] => Y
[CAN_BUY] => Y
[MIN_PRICE] => N
[CURRENCY] => RUB
[VALUE_VAT] => 2558
[VALUE_NOVAT] => 2558
[DISCOUNT_VALUE_VAT] => 2558
[DISCOUNT_VALUE_NOVAT] => 2558
[ROUND_VALUE_VAT] => 2558
[ROUND_VALUE_NOVAT] => 2558
[VALUE] => 2558
[UNROUND_DISCOUNT_VALUE] => 2558
[DISCOUNT_VALUE] => 2558
[DISCOUNT_DIFF] => 0
[DISCOUNT_DIFF_PERCENT] => 0
[VATRATE_VALUE] => 0
[DISCOUNT_VATRATE_VALUE] => 0
[ROUND_VATRATE_VALUE] => 0
[PRINT_VALUE_NOVAT] => 2 558 руб.
[PRINT_VALUE_VAT] => 2 558 руб.
[PRINT_VATRATE_VALUE] => 0 руб.
[PRINT_DISCOUNT_VALUE_NOVAT] => 2 558 руб.
[PRINT_DISCOUNT_VALUE_VAT] => 2 558 руб.
[PRINT_DISCOUNT_VATRATE_VALUE] => 0 руб.
[PRINT_VALUE] => 2 558 руб.
[PRINT_DISCOUNT_VALUE] => 2 558 руб.
[PRINT_DISCOUNT_DIFF] => 0 руб.
)
)
AddEventHandler("main", "OnBeforeUserRegister", "OnBeforeUserRegisterHandler");
function OnBeforeUserRegisterHandler($args)
{
/*capcha */
if (isset($_POST['recaptcha_response'])) {
$recaptcha_key = 'секретный ключ';
$recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
$recaptcha_params = [
'secret' => $recaptcha_key,
'response' => $_POST['recaptcha_response'],
'remoteip' => $_SERVER['REMOTE_ADDR'],
];
$ch = curl_init($recaptcha_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $recaptcha_params);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
if (!empty($response)) {
$decoded_response = json_decode($response);
}
$recaptcha_success = false;
//dbg2f($decoded_response, 'responce');
if ($decoded_response && $decoded_response->score > 0) {
$recaptcha_success = $decoded_response->score;
// ???????????? ?????? ?????, ??????? ???????? ??????
} else {
// ??????????? ????????, ???? ???????????? ???????? ?????
}
}
if ($recaptcha_success < 0.5){
global $APPLICATION;
$APPLICATION->ThrowException('ReCaptcha ?? ???????? ??? ???');
return false;
}
return true;
}
AddEventHandler("main", "OnBeforeUserRegister", "OnBeforeUserRegisterHandler");
function OnBeforeUserRegisterHandler($args)
{
/*capcha */
if (isset($args['recaptcha_response'])) {
$recaptcha_key = ' секретный код';
$recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
$recaptcha_params = [
'secret' => $recaptcha_key,
'response' => $args['recaptcha_response'],
'remoteip' => $_SERVER['REMOTE_ADDR'],
];
$ch = curl_init($recaptcha_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $recaptcha_params);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
if (!empty($response)) {
$decoded_response = json_decode($response);
}
$recaptcha_success = false;
//dbg2f($decoded_response, 'responce');
if ($decoded_response && $decoded_response->score > 0) {
$recaptcha_success = $decoded_response->score;
// обрабатываем данные формы, которая защищена капчей
} else {
// прописываем действие, если пользователь оказался ботом
}
}
if ($recaptcha_success >= 0.5){
global $APPLICATION;
$APPLICATION->ThrowException('ReCaptcha не пройдена.');
return false;
}
}
Array
(
[LOGIN] => testtest
[NAME] => test2
[LAST_NAME] => test
[PASSWORD] => testtest
[CHECKWORD] => fc543410d07e8dd55cf57494020c074c
[~CHECKWORD_TIME] => now()
[CONFIRM_PASSWORD] => testtest
[EMAIL] => test@gmail.com
[PHONE_NUMBER] =>
[ACTIVE] => N
[CONFIRM_CODE] => 3J1m0ilB
[SITE_ID] => s1
[LANGUAGE_ID] => ru
[USER_IP] => 178.34.158.34
[USER_HOST] => 178.34.158.34
[GROUP_ID] => Array
(
[0] => 5
)
)
// регистрируем обработчик события "OnBeforeUserRegister"
RegisterModuleDependences("main", "OnBeforeUserRegister", "my_module_id", "MyClass", "OnBeforeUserRegisterHandler");
<?
// файл /bitrix/modules/my_module_id/include.php
class MyClass
{
// создаем обработчик события "OnBeforeUserRegister"
function OnBeforeUserRegisterHandler(&$arFields)
{
/*capcha */
if (isset($_POST['recaptcha_response'])) {
$recaptcha_key = 'секретный ключ';
$recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
$recaptcha_params = [
'secret' => $recaptcha_key,
'response' => $_POST['recaptcha_response'],
'remoteip' => $_SERVER['REMOTE_ADDR'],
];
$ch = curl_init($recaptcha_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $recaptcha_params);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
if (!empty($response)) {
$decoded_response = json_decode($response);
}
$recaptcha_success = false;
//dbg2f($decoded_response, 'responce');
if ($decoded_response && $decoded_response->score > 0) {
$recaptcha_success = $decoded_response->score;
// ???????????? ?????? ?????, ??????? ???????? ??????
} else {
// ??????????? ????????, ???? ???????????? ???????? ?????
}
}
/*capcha */
if ($recaptcha_success < 0.5)
{
// ОТМЕНА РЕГИСТРАЦИИ ,КАК НАПИСАТЬ ?
$GLOBALS['APPLICATION']->ThrowException(' рекапча не заполнена это бот ');
return false;
}
return true;
}
}
?>
https://playmarketgames.ru/catalog/playstation_4/f...