Server IP : 85.193.89.191 / Your IP : 3.15.193.254 Web Server : Apache System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : bitrix ( 600) PHP Version : 8.1.27 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/bitrix/www/desktop_app/login/ |
Upload File : |
<?php /** * @global \CUser $USER * @global \CMain $APPLICATION */ function sendResponse(array $answer, string $httpCode = '200 OK') { \CHTTP::SetStatus($httpCode); if ( defined('RESPONSE_JSON') || isset($_REQUEST['json']) && $_REQUEST['json'] == 'y' ) { header('Content-Type: application/json'); echo \Bitrix\Main\Web\Json::encode($answer); \Bitrix\Main\Application::getInstance()->end(); } $answerParts = array(); foreach($answer as $attr => $value) { switch(gettype($value)) { case 'string': $value = "'".CUtil::JSEscape($value)."'"; break; case 'boolean': $value = ($value === true? 'true': 'false'); break; case 'array': $value = toJsObject($value); break; } $answerParts[] = $attr.": ".$value; } echo "{".implode(", ", $answerParts)."}"; \Bitrix\Main\Application::getInstance()->end(); } function isAccessAllowed() { global $USER; if ($USER->IsAdmin()) { return true; } if (!\Bitrix\Main\Loader::includeModule('intranet')) { return true; } if (\Bitrix\Intranet\Util::isIntranetUser()) { return true; } if (\Bitrix\Intranet\Util::isExtranetUser()) { return true; } return false; }