getSelfFolderUrl(); $listUrl = $selfFolderUrl."sale_pay_system.php?lang=".LANGUAGE_ID; $listUrl = $adminSidePanelHelper->editUrlToPublicPage($listUrl); $application = \Bitrix\Main\Application::getInstance(); $context = $application->getContext(); $request = $context->getRequest(); global $APPLICATION; $id = (int)$request->get('pay_system_id'); $personTypeId = $request->getQuery("personTypeId"); $personTypeList = \Bitrix\Sale\BusinessValue::getPersonTypes(); $errorMsg = ''; $paySystemData = PaySystem\Manager::getById($id); if (!$paySystemData || $paySystemData['ACTION_FILE'] !== 'yandexinvoice') { $adminSidePanelHelper->localRedirect($listUrl); LocalRedirect($listUrl); } \CUtil::InitJSCore(); if ($request->getPost("Save") && check_bitrix_sessid()) { $sitesData = $request->getPost("settings"); foreach ($sitesData as $personTypeId => $fields) { if ($fields["SETTINGS_CLEAR_ALL"]) { $shopId = \Bitrix\Sale\BusinessValue::get('YANDEX_INVOICE_SHOP_ID', 'PAYSYSTEM_'.$id, $personTypeId); if ($shopId) \Bitrix\Sale\Internals\YandexSettingsTable::delete($shopId); } if ($fields["SETTINGS_CLEAR"]) { $shopId = \Bitrix\Sale\BusinessValue::get('YANDEX_INVOICE_SHOP_ID', 'PAYSYSTEM_'.$id, $personTypeId); if ($shopId) \Bitrix\Sale\Internals\YandexSettingsTable::update($shopId, array('PUB_KEY' => '')); } $file = $request->getFile("YANDEX_PUB_KEY_".$personTypeId); if (file_exists($file['tmp_name'])) { $publicKey = file_get_contents($file['tmp_name']); if (openssl_pkey_get_public($publicKey)) { $shopId = \Bitrix\Sale\BusinessValue::get('YANDEX_INVOICE_SHOP_ID', 'PAYSYSTEM_'.$id, $personTypeId); if ($shopId <> '') \Bitrix\Sale\Internals\YandexSettingsTable::update($shopId, array('PUB_KEY' => $publicKey)); } else { $errorMsg .= GetMessage('SALE_YANDEX_INVOICE_SETTINGS_ERROR_PUBLIC_KEY_LOAD'); } } } if ($errorMsg === '') { $redirectUrl = $APPLICATION->GetCurPage()."?pay_system_id=".$id."&lang=".LANGUAGE_ID; $adminSidePanelHelper->localRedirect($redirectUrl); LocalRedirect($redirectUrl); } } if ($request->get('generate') === 'Y') { $personTypeId = $request->get('person_type_id'); $shopId = \Bitrix\Sale\BusinessValue::get('YANDEX_INVOICE_SHOP_ID', 'PAYSYSTEM_'.$id, $personTypeId); if ($shopId <> '') { $dbRes = \Bitrix\Sale\Internals\YandexSettingsTable::getById($shopId); $yandexSettings = $dbRes->fetch(); if (!$yandexSettings || !$yandexSettings['PKEY']) { $command = 'openssl ecparam -name prime256v1 -genkey | openssl pkcs8 -topk8 -nocrypt'; $descriptorSpec = array(1 => array("pipe", "w")); $process = proc_open($command, $descriptorSpec, $pipes); $privateKey = stream_get_contents($pipes[1]); $return_value = proc_close($process); $dbRes = \Bitrix\Sale\Internals\YandexSettingsTable::getById($shopId); if ($dbRes->fetch()) \Bitrix\Sale\Internals\YandexSettingsTable::update($shopId, array('PKEY' => $privateKey)); else \Bitrix\Sale\Internals\YandexSettingsTable::add(array('SHOP_ID' => $shopId, 'PKEY' => $privateKey)); } else { $errorMsg = Loc::getMessage('SALE_YANDEX_INVOICE_SETTINGS_ALREADY_CONFIGURED'); } if ($errorMsg === '') { $redirectUrl = $APPLICATION->GetCurPage()."?pay_system_id=".$id."&lang=".LANGUAGE_ID; $adminSidePanelHelper->localRedirect($redirectUrl); LocalRedirect($redirectUrl); } } } else if ($request->get('download') === 'Y') { $personTypeId = $request->get('person_type_id'); $shopId = \Bitrix\Sale\BusinessValue::get('YANDEX_INVOICE_SHOP_ID', 'PAYSYSTEM_'.$id, $personTypeId); $APPLICATION->RestartBuffer(); header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=public_key.pem'); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); $dbRes = \Bitrix\Sale\Internals\YandexSettingsTable::getById($shopId); $yandexSettings = $dbRes->fetch(); if ($yandexSettings) { $pkeyRes = openssl_get_privatekey($yandexSettings['PKEY']); $pkeyDetail = openssl_pkey_get_details($pkeyRes); echo $pkeyDetail['key']; die(); } } require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/sale/prolog.php"); $APPLICATION->SetTitle(Loc::getMessage('SALE_YANDEX_INVOICE_SETTINGS_TITLE')); require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_after.php"); if ($errorMsg !== '') CAdminMessage::ShowMessage(array("DETAILS"=>$errorMsg, "TYPE"=>"ERROR", "HTML"=>true)); $personTypeTabs = array(); $personTypeTabs[] = array( "PERSON_TYPE" => 0, "DIV" => 0, "TAB" => Loc::getMessage('SALE_YANDEX_INVOICE_SETTINGS_BY_DEFAULT'), "TITLE" => Loc::getMessage("SALE_YANDEX_INVOICE_SETTINGS_PT").": ".Loc::getMessage('SALE_YANDEX_INVOICE_SETTINGS_BY_DEFAULT') ); foreach ($personTypeList as $personTypeId) { $personTypeTabs[] = array( "PERSON_TYPE" => $personTypeId["ID"], "DIV" => $personTypeId["ID"], "TAB" => $personTypeId["NAME"]." (".$personTypeId['LID'].")", "TITLE" => Loc::getMessage("SALE_YANDEX_INVOICE_SETTINGS_PT").": ".$personTypeId["NAME"] ); } $tabRControl = new \CAdminTabControl("tabRControl", $personTypeTabs); $showButton = false; ?> Loc::getMessage("SPSN_2FLIST"), "LINK" => $adminSidePanelHelper->editUrlToPublicPage($selfFolderUrl."sale_pay_system_edit.php?ID=".$id."&lang=".$context->getLanguage()), "ICON" => "btn_list" ) ); $contextMenu = new CAdminContextMenu($aMenu); $contextMenu->Show(); ?> Begin();?> GetCurPage()."?pay_system_id=".$id."&lang=".LANGUAGE_ID; $actionUrl = $adminSidePanelHelper->setDefaultQueryParams($actionUrl); ?>

Fatal error: Uncaught Error: Call to undefined function bitrix_sessid_post() in D:\ktt\ttepla.com\public_html\bitrix\modules\sale\admin\yandexinvoice_settings.php:191 Stack trace: #0 {main} thrown in D:\ktt\ttepla.com\public_html\bitrix\modules\sale\admin\yandexinvoice_settings.php on line 191