%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.225.156.236 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/main/lib/service/microservice/ |
Upload File : |
<?php namespace Bitrix\Main\Service\MicroService; use Bitrix\Main\Config\Option; use Bitrix\Main\Loader; class Client { const TYPE_BITRIX24 = "B24"; const TYPE_BOX = "BOX"; public static function getPortalType(): string { if(Loader::includeModule("bitrix24") && defined("BX24_HOST_NAME")) { return static::TYPE_BITRIX24; } else { return static::TYPE_BOX; } } /** * Return license code of the portal (to be used as a part of request verification scheme). * * @return string */ public static function getLicenseCode(): string { if(defined('BX24_HOST_NAME')) { return BX24_HOST_NAME; } else { require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/update_client.php"); return md5("BITRIX".\CUpdateClient::GetLicenseKey()."LICENCE"); } } public static function getServerName(): string { if(defined('BX24_HOST_NAME')) { return "https://" . BX24_HOST_NAME; } else { return (\CMain::isHTTPS() ? "https" : "http")."://".((defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0) ? SITE_SERVER_NAME : Option::get("main", "server_name")); } } /** * Returns request authorization hash string. * * @param array $parameters Array or request parameters to be signed. * @param string $suffix Suffix to append to signed string * * @return string */ public static function signRequest(array $parameters, string $suffix = ""): string { $paramStr = md5(implode("|", $parameters) . ($suffix ? "|" . $suffix : "")); $portalType = static::getPortalType(); if ($portalType == self::TYPE_BITRIX24 && function_exists('bx_sign')) { return bx_sign($paramStr); } else { include($_SERVER["DOCUMENT_ROOT"]."/bitrix/license_key.php"); return md5($paramStr.md5($LICENSE_KEY)); } } }