1
0
Fork 0
mirror of synced 2025-04-20 01:21:01 +00:00

Displaying error message about forbidden api method

This commit is contained in:
Akolzin Dmitry 2017-12-04 17:40:59 +03:00
parent f02b367251
commit 43dc6d75a4
3 changed files with 14 additions and 1 deletions

View file

@ -354,7 +354,15 @@ class intaro_retailcrm extends CModule
'intaro.retailcrm/install/index.php', 'RetailCrm\ApiClient::*List::CurlException',
$e->getCode() . ': ' . $e->getMessage()
);
} catch (\InvalidArgumentException $e) {
$arResult['errCode'] = 'ERR_METHOD_NOT_FOUND';
$APPLICATION->IncludeAdminFile(
GetMessage('MODULE_INSTALL_TITLE'), $this->INSTALL_PATH . '/step1.php'
);
return;
}
$delivTypes = array();
foreach ($arResult['deliveryTypesList'] as $delivType) {
if ($delivType['active'] === true) {

View file

@ -27,6 +27,7 @@ $MESS ['ICRM_OPTIONS_SUBMIT_VALUE'] = 'Сохранить';
$MESS ['ERR_404'] = 'Возможно не верно введен адрес CRM.';
$MESS ['ERR_403'] = 'Неверный apiKey.';
$MESS ['ERR_JSON'] = 'Получены некорректные данные из CRM, проверьте данные справочников в настройках';
$MESS ['ERR_0'] = 'Превышено время ожидания ответа от сервера.';
$MESS ['ICRM_OPTIONS_OK'] = 'Изменения успешно сохранены.';
$MESS ['CANCELED'] = 'Является флагом «Отменен»';

View file

@ -544,7 +544,11 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) {
} catch (InvalidArgumentException $e) {
$badKey = true;
echo CAdminMessage::ShowMessage(GetMessage('ERR_403'));
} catch (\RetailCrm\Exception\InvalidJsonException $e) {
$badJson = true;
echo CAdminMessage::ShowMessage(GetMessage('ERR_JSON'));
}
$delivTypes = array();
foreach ($arResult['deliveryTypesList'] as $delivType) {
if ($delivType['active'] === true) {
@ -814,7 +818,7 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) {
</tr>
<?php endforeach; ?>
<?php endif;?>
<?php if(!$badKey):?>
<?php if(!$badKey && !$badJson):?>
<?php $tabControl->BeginNextTab(); ?>
<input type="hidden" name="tab" value="catalog">
<tr class="option-head">