Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/esol.importxml/lib/vendors/ |
Upload File : |
<?php namespace IX; class Apibraincomua { public static function GetAuthParams() { return array( 'login', 'password' ); } public static function GetDownloadPath(&$path, &$arParams) { session_start(); if(!isset($_SESSION['APIBRAINCOMUA_SID'])) { if(!function_exists('json_encode')) return false; $postParams = $arParams['VARS']; if(!$postParams['login'] || !$postParams['password']) return false; $client = new \Bitrix\Main\Web\HttpClient(array('disableSslVerification' => true)); $res = $client->post('http://api.brain.com.ua/auth', array('login'=>trim($postParams['login']), 'password'=>md5(trim($postParams['password'])))); $arRes = json_decode($res, true); if(!$arRes['result']) return false; $_SESSION['APIBRAINCOMUA_SID'] = $arRes['result']; } $sid = $_SESSION['APIBRAINCOMUA_SID']; $sess = $_SESSION; session_write_close(); $_SESSION = $sess; $path = preg_replace('/(\/)SID(\/|\?|$)/i', '/'.$sid.'$2', $path); unset($arParams['VARS'], $arParams['PAGEAUTH'], $arParams['POSTPAGEAUTH']); return true; } } ?>