From 0ca62f9e287a517ccfb6ba7dfe85161fdf72642c Mon Sep 17 00:00:00 2001 From: Ivan Chaplygin Date: Wed, 30 Aug 2023 12:18:35 +0300 Subject: [PATCH] =?UTF-8?q?ref=20#91590=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B0=D0=B4=D1=80=D0=B5=D1=81=D0=B0=20=D0=B8=20?= =?UTF-8?q?=D0=BA=D0=BB=D1=8E=D1=87=D0=B0=20=D0=BD=D0=B0=20=D0=BF=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=BE=D1=82=D1=83=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE?= =?UTF-8?q?=D0=B4=D1=8B=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- intaro.retailcrm/lang/en/options.php | 3 +++ intaro.retailcrm/lang/ru/options.php | 3 +++ intaro.retailcrm/options.php | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/intaro.retailcrm/lang/en/options.php b/intaro.retailcrm/lang/en/options.php index df3f536b..ea4f29d0 100644 --- a/intaro.retailcrm/lang/en/options.php +++ b/intaro.retailcrm/lang/en/options.php @@ -107,3 +107,6 @@ For the integration to work correctly, the currencies in CRM and CMS must match' $MESS ['ACTIVITY_SETTINGS'] = 'Module activity settings'; $MESS ['DEACTIVATE_MODULE'] = 'Deactivate the module'; + +$MESS ['WRONG_CREDENTIALS'] = 'Enter the address and authorization key of the CRM system'; +$MESS ['Wrong "apiKey" value.'] = 'Invalid authorization key'; diff --git a/intaro.retailcrm/lang/ru/options.php b/intaro.retailcrm/lang/ru/options.php index 1424dc2e..d96fb87c 100644 --- a/intaro.retailcrm/lang/ru/options.php +++ b/intaro.retailcrm/lang/ru/options.php @@ -166,3 +166,6 @@ $MESS ['TEMPLATE_COPING_ERROR'] = 'Ошибка копирования шабл $MESS ['ACTIVITY_SETTINGS'] = 'Настройки активности модуля'; $MESS ['DEACTIVATE_MODULE'] = 'Деактивировать модуль'; + +$MESS ['WRONG_CREDENTIALS'] = 'Введите адрес и ключ авторизации CRM системы'; +$MESS ['Wrong "apiKey" value.'] = 'Недействительный ключ авторизации'; diff --git a/intaro.retailcrm/options.php b/intaro.retailcrm/options.php index 022f4812..ea77b462 100644 --- a/intaro.retailcrm/options.php +++ b/intaro.retailcrm/options.php @@ -276,6 +276,10 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) { COption::SetOptionString($mid, 'api_host', $api_host); COption::SetOptionString($mid, 'api_key', $api_key); + } else { + $uri .= '&errc=ERR_WRONG_CREDENTIALS'; + + LocalRedirect($uri); } //form order types ids arr @@ -1065,7 +1069,7 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) { $errorsText = []; if (preg_match('/&errc=ERR_(.*)/is', $APPLICATION->GetCurUri(), $matches)) { - $errorsText[] = urldecode($matches[1]); + $errorsText[] = GetMessage(urldecode($matches[1])); } if (empty($errorsText)) {