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)) {