/modules/main/include.php

https://gitlab.com/alexprowars/bitrix · PHP · 510 lines · 386 code · 79 blank · 45 comment · 134 complexity · 20071920d93f2923c82cb7d6ce0b7042 MD5 · raw file

  1. <?php
  2. /**
  3. * Bitrix Framework
  4. * @package bitrix
  5. * @subpackage main
  6. * @copyright 2001-2013 Bitrix
  7. */
  8. use Bitrix\Main\Session\Legacy\HealerEarlySessionStart;
  9. require_once(__DIR__."/bx_root.php");
  10. require_once(__DIR__."/start.php");
  11. $application = \Bitrix\Main\Application::getInstance();
  12. $application->initializeExtendedKernel(array(
  13. "get" => $_GET,
  14. "post" => $_POST,
  15. "files" => $_FILES,
  16. "cookie" => $_COOKIE,
  17. "server" => $_SERVER,
  18. "env" => $_ENV
  19. ));
  20. //define global application object
  21. $GLOBALS["APPLICATION"] = new CMain;
  22. if(defined("SITE_ID"))
  23. define("LANG", SITE_ID);
  24. if(defined("LANG"))
  25. {
  26. if(defined("ADMIN_SECTION") && ADMIN_SECTION===true)
  27. $db_lang = CLangAdmin::GetByID(LANG);
  28. else
  29. $db_lang = CLang::GetByID(LANG);
  30. $arLang = $db_lang->Fetch();
  31. if(!$arLang)
  32. {
  33. throw new \Bitrix\Main\SystemException("Incorrect site: ".LANG.".");
  34. }
  35. }
  36. else
  37. {
  38. $arLang = $GLOBALS["APPLICATION"]->GetLang();
  39. define("LANG", $arLang["LID"]);
  40. }
  41. if($arLang["CULTURE_ID"] == '')
  42. {
  43. throw new \Bitrix\Main\SystemException("Culture not found, or there are no active sites or languages.");
  44. }
  45. $lang = $arLang["LID"];
  46. if (!defined("SITE_ID"))
  47. define("SITE_ID", $arLang["LID"]);
  48. define("SITE_DIR", ($arLang["DIR"] ?? ''));
  49. define("SITE_SERVER_NAME", ($arLang["SERVER_NAME"] ?? ''));
  50. define("SITE_CHARSET", $arLang["CHARSET"]);
  51. define("FORMAT_DATE", $arLang["FORMAT_DATE"]);
  52. define("FORMAT_DATETIME", $arLang["FORMAT_DATETIME"]);
  53. define("LANG_DIR", ($arLang["DIR"] ?? ''));
  54. define("LANG_CHARSET", $arLang["CHARSET"]);
  55. define("LANG_ADMIN_LID", $arLang["LANGUAGE_ID"]);
  56. define("LANGUAGE_ID", $arLang["LANGUAGE_ID"]);
  57. $culture = \Bitrix\Main\Localization\CultureTable::getByPrimary($arLang["CULTURE_ID"], ["cache" => ["ttl" => CACHED_b_lang]])->fetchObject();
  58. $context = $application->getContext();
  59. $context->setLanguage(LANGUAGE_ID);
  60. $context->setCulture($culture);
  61. $request = $context->getRequest();
  62. if (!$request->isAdminSection())
  63. {
  64. $context->setSite(SITE_ID);
  65. }
  66. $application->start();
  67. $GLOBALS["APPLICATION"]->reinitPath();
  68. if (!defined("POST_FORM_ACTION_URI"))
  69. {
  70. define("POST_FORM_ACTION_URI", htmlspecialcharsbx(GetRequestUri()));
  71. }
  72. $GLOBALS["MESS"] = [];
  73. $GLOBALS["ALL_LANG_FILES"] = [];
  74. IncludeModuleLangFile(__DIR__."/tools.php");
  75. IncludeModuleLangFile(__FILE__);
  76. error_reporting(COption::GetOptionInt("main", "error_reporting", E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR|E_PARSE) & ~E_STRICT & ~E_DEPRECATED);
  77. if(!defined("BX_COMP_MANAGED_CACHE") && COption::GetOptionString("main", "component_managed_cache_on", "Y") <> "N")
  78. {
  79. define("BX_COMP_MANAGED_CACHE", true);
  80. }
  81. // global functions
  82. require_once(__DIR__."/filter_tools.php");
  83. define('BX_AJAX_PARAM_ID', 'bxajaxid');
  84. /*ZDUyZmZNjVhZThiNjNkOTZlZDE1OTE2YTM1NmVjZTNhODAwZTk=*/$GLOBALS['____2131814890']= array(base64_decode('ZGVmaW5l'));if(!function_exists(__NAMESPACE__.'\\___1614983869')){function ___1614983869($_321374208){static $_1997553827= false; if($_1997553827 == false) $_1997553827=array('RU5'.'DT0RF','WQ='.'=');return base64_decode($_1997553827[$_321374208]);}};class CBXFeatures{ public static function IsFeatureEnabled($_1585349041){ return true;} public static function IsFeatureEditable($_1585349041){ return true;} public static function SetFeatureEnabled($_1585349041, $_1373124910= true){} public static function SaveFeaturesSettings($_1252506144, $_63900902){} public static function GetFeaturesList(){ return array();} public static function InitiateEditionsSettings($_1317691075){} public static function ModifyFeaturesSettings($_1317691075, $_867319609){} public static function IsFeatureInstalled($_1585349041){ return true;}} $GLOBALS['____2131814890'][0](___1614983869(0), ___1614983869(1));/**/ //Do not remove this
  85. //component 2.0 template engines
  86. $GLOBALS["arCustomTemplateEngines"] = [];
  87. require_once(__DIR__."/autoload.php");
  88. require_once(__DIR__."/classes/general/menu.php");
  89. require_once(__DIR__."/classes/mysql/usertype.php");
  90. if(file_exists(($_fname = __DIR__."/classes/general/update_db_updater.php")))
  91. {
  92. $US_HOST_PROCESS_MAIN = False;
  93. include($_fname);
  94. }
  95. if(file_exists(($_fname = $_SERVER["DOCUMENT_ROOT"]."/bitrix/init.php")))
  96. include_once($_fname);
  97. if(($_fname = getLocalPath("php_interface/init.php", BX_PERSONAL_ROOT)) !== false)
  98. include_once($_SERVER["DOCUMENT_ROOT"].$_fname);
  99. if(($_fname = getLocalPath("php_interface/".SITE_ID."/init.php", BX_PERSONAL_ROOT)) !== false)
  100. include_once($_SERVER["DOCUMENT_ROOT"].$_fname);
  101. if(!defined("BX_FILE_PERMISSIONS"))
  102. define("BX_FILE_PERMISSIONS", 0644);
  103. if(!defined("BX_DIR_PERMISSIONS"))
  104. define("BX_DIR_PERMISSIONS", 0755);
  105. //global var, is used somewhere
  106. $GLOBALS["sDocPath"] = $GLOBALS["APPLICATION"]->GetCurPage();
  107. if((!(defined("STATISTIC_ONLY") && STATISTIC_ONLY && mb_substr($GLOBALS["APPLICATION"]->GetCurPage(), 0, mb_strlen(BX_ROOT."/admin/")) != BX_ROOT."/admin/")) && COption::GetOptionString("main", "include_charset", "Y")=="Y" && LANG_CHARSET <> '')
  108. header("Content-Type: text/html; charset=".LANG_CHARSET);
  109. if(COption::GetOptionString("main", "set_p3p_header", "Y")=="Y")
  110. header("P3P: policyref=\"/bitrix/p3p.xml\", CP=\"NON DSP COR CUR ADM DEV PSA PSD OUR UNR BUS UNI COM NAV INT DEM STA\"");
  111. header("X-Powered-CMS: Bitrix Site Manager (".(LICENSE_KEY == "DEMO"? "DEMO" : md5("BITRIX".LICENSE_KEY."LICENCE")).")");
  112. if (COption::GetOptionString("main", "update_devsrv", "") == "Y")
  113. header("X-DevSrv-CMS: Bitrix");
  114. if (!defined("BX_CRONTAB_SUPPORT"))
  115. {
  116. define("BX_CRONTAB_SUPPORT", defined("BX_CRONTAB"));
  117. }
  118. //agents
  119. if(COption::GetOptionString("main", "check_agents", "Y") == "Y")
  120. {
  121. $application->addBackgroundJob(["CAgent", "CheckAgents"], [], \Bitrix\Main\Application::JOB_PRIORITY_LOW);
  122. }
  123. //send email events
  124. if(COption::GetOptionString("main", "check_events", "Y") !== "N")
  125. {
  126. $application->addBackgroundJob(['\Bitrix\Main\Mail\EventManager', 'checkEvents'], [], \Bitrix\Main\Application::JOB_PRIORITY_LOW-1);
  127. }
  128. $healerOfEarlySessionStart = new HealerEarlySessionStart();
  129. $healerOfEarlySessionStart->process($application->getKernelSession());
  130. $kernelSession = $application->getKernelSession();
  131. $kernelSession->start();
  132. $application->getSessionLocalStorageManager()->setUniqueId($kernelSession->getId());
  133. foreach (GetModuleEvents("main", "OnPageStart", true) as $arEvent)
  134. ExecuteModuleEventEx($arEvent);
  135. //define global user object
  136. $GLOBALS["USER"] = new CUser;
  137. //session control from group policy
  138. $arPolicy = $GLOBALS["USER"]->GetSecurityPolicy();
  139. $currTime = time();
  140. if(
  141. (
  142. //IP address changed
  143. $kernelSession['SESS_IP']
  144. && $arPolicy["SESSION_IP_MASK"] <> ''
  145. && (
  146. (ip2long($arPolicy["SESSION_IP_MASK"]) & ip2long($kernelSession['SESS_IP']))
  147. !=
  148. (ip2long($arPolicy["SESSION_IP_MASK"]) & ip2long($_SERVER['REMOTE_ADDR']))
  149. )
  150. )
  151. ||
  152. (
  153. //session timeout
  154. $arPolicy["SESSION_TIMEOUT"]>0
  155. && $kernelSession['SESS_TIME']>0
  156. && $currTime-$arPolicy["SESSION_TIMEOUT"]*60 > $kernelSession['SESS_TIME']
  157. )
  158. ||
  159. (
  160. //signed session
  161. isset($kernelSession["BX_SESSION_SIGN"])
  162. && $kernelSession["BX_SESSION_SIGN"] <> bitrix_sess_sign()
  163. )
  164. ||
  165. (
  166. //session manually expired, e.g. in $User->LoginHitByHash
  167. isSessionExpired()
  168. )
  169. )
  170. {
  171. $compositeSessionManager = $application->getCompositeSessionManager();
  172. $compositeSessionManager->destroy();
  173. $application->getSession()->setId(md5(uniqid(rand(), true)));
  174. $compositeSessionManager->start();
  175. $GLOBALS["USER"] = new CUser;
  176. }
  177. $kernelSession['SESS_IP'] = $_SERVER['REMOTE_ADDR'];
  178. if (empty($kernelSession['SESS_TIME']))
  179. {
  180. $kernelSession['SESS_TIME'] = $currTime;
  181. }
  182. elseif (($currTime - $kernelSession['SESS_TIME']) > 60)
  183. {
  184. $kernelSession['SESS_TIME'] = $currTime;
  185. }
  186. if(!isset($kernelSession["BX_SESSION_SIGN"]))
  187. {
  188. $kernelSession["BX_SESSION_SIGN"] = bitrix_sess_sign();
  189. }
  190. //session control from security module
  191. if(
  192. (COption::GetOptionString("main", "use_session_id_ttl", "N") == "Y")
  193. && (COption::GetOptionInt("main", "session_id_ttl", 0) > 0)
  194. && !defined("BX_SESSION_ID_CHANGE")
  195. )
  196. {
  197. if(!isset($kernelSession['SESS_ID_TIME']))
  198. {
  199. $kernelSession['SESS_ID_TIME'] = $currTime;
  200. }
  201. elseif(($kernelSession['SESS_ID_TIME'] + COption::GetOptionInt("main", "session_id_ttl")) < $kernelSession['SESS_TIME'])
  202. {
  203. $compositeSessionManager = $application->getCompositeSessionManager();
  204. $compositeSessionManager->regenerateId();
  205. $kernelSession['SESS_ID_TIME'] = $currTime;
  206. }
  207. }
  208. define("BX_STARTED", true);
  209. if (isset($kernelSession['BX_ADMIN_LOAD_AUTH']))
  210. {
  211. define('ADMIN_SECTION_LOAD_AUTH', 1);
  212. unset($kernelSession['BX_ADMIN_LOAD_AUTH']);
  213. }
  214. if(!defined("NOT_CHECK_PERMISSIONS") || NOT_CHECK_PERMISSIONS!==true)
  215. {
  216. $doLogout = isset($_REQUEST["logout"]) && (strtolower($_REQUEST["logout"]) == "yes");
  217. if($doLogout && $GLOBALS["USER"]->IsAuthorized())
  218. {
  219. $secureLogout = (\Bitrix\Main\Config\Option::get("main", "secure_logout", "N") == "Y");
  220. if(!$secureLogout || check_bitrix_sessid())
  221. {
  222. $GLOBALS["USER"]->Logout();
  223. LocalRedirect($GLOBALS["APPLICATION"]->GetCurPageParam('', array('logout', 'sessid')));
  224. }
  225. }
  226. // authorize by cookies
  227. if(!$GLOBALS["USER"]->IsAuthorized())
  228. {
  229. $GLOBALS["USER"]->LoginByCookies();
  230. }
  231. $arAuthResult = false;
  232. //http basic and digest authorization
  233. if(($httpAuth = $GLOBALS["USER"]->LoginByHttpAuth()) !== null)
  234. {
  235. $arAuthResult = $httpAuth;
  236. $GLOBALS["APPLICATION"]->SetAuthResult($arAuthResult);
  237. }
  238. //Authorize user from authorization html form
  239. //Only POST is accepted
  240. if(isset($_POST["AUTH_FORM"]) && $_POST["AUTH_FORM"] <> '')
  241. {
  242. $bRsaError = false;
  243. if(COption::GetOptionString('main', 'use_encrypted_auth', 'N') == 'Y')
  244. {
  245. //possible encrypted user password
  246. $sec = new CRsaSecurity();
  247. if(($arKeys = $sec->LoadKeys()))
  248. {
  249. $sec->SetKeys($arKeys);
  250. $errno = $sec->AcceptFromForm(['USER_PASSWORD', 'USER_CONFIRM_PASSWORD', 'USER_CURRENT_PASSWORD']);
  251. if($errno == CRsaSecurity::ERROR_SESS_CHECK)
  252. $arAuthResult = array("MESSAGE"=>GetMessage("main_include_decode_pass_sess"), "TYPE"=>"ERROR");
  253. elseif($errno < 0)
  254. $arAuthResult = array("MESSAGE"=>GetMessage("main_include_decode_pass_err", array("#ERRCODE#"=>$errno)), "TYPE"=>"ERROR");
  255. if($errno < 0)
  256. $bRsaError = true;
  257. }
  258. }
  259. if($bRsaError == false)
  260. {
  261. if(!defined("ADMIN_SECTION") || ADMIN_SECTION !== true)
  262. $USER_LID = SITE_ID;
  263. else
  264. $USER_LID = false;
  265. if($_POST["TYPE"] == "AUTH")
  266. {
  267. $arAuthResult = $GLOBALS["USER"]->Login($_POST["USER_LOGIN"], $_POST["USER_PASSWORD"], $_POST["USER_REMEMBER"]);
  268. }
  269. elseif($_POST["TYPE"] == "OTP")
  270. {
  271. $arAuthResult = $GLOBALS["USER"]->LoginByOtp($_POST["USER_OTP"], $_POST["OTP_REMEMBER"], $_POST["captcha_word"], $_POST["captcha_sid"]);
  272. }
  273. elseif($_POST["TYPE"] == "SEND_PWD")
  274. {
  275. $arAuthResult = CUser::SendPassword($_POST["USER_LOGIN"], $_POST["USER_EMAIL"], $USER_LID, $_POST["captcha_word"], $_POST["captcha_sid"], $_POST["USER_PHONE_NUMBER"]);
  276. }
  277. elseif($_POST["TYPE"] == "CHANGE_PWD")
  278. {
  279. $arAuthResult = $GLOBALS["USER"]->ChangePassword($_POST["USER_LOGIN"], $_POST["USER_CHECKWORD"], $_POST["USER_PASSWORD"], $_POST["USER_CONFIRM_PASSWORD"], $USER_LID, $_POST["captcha_word"], $_POST["captcha_sid"], true, $_POST["USER_PHONE_NUMBER"], $_POST["USER_CURRENT_PASSWORD"]);
  280. }
  281. elseif(COption::GetOptionString("main", "new_user_registration", "N") == "Y" && $_POST["TYPE"] == "REGISTRATION" && (!defined("ADMIN_SECTION") || ADMIN_SECTION !== true))
  282. {
  283. $arAuthResult = $GLOBALS["USER"]->Register($_POST["USER_LOGIN"], $_POST["USER_NAME"], $_POST["USER_LAST_NAME"], $_POST["USER_PASSWORD"], $_POST["USER_CONFIRM_PASSWORD"], $_POST["USER_EMAIL"], $USER_LID, $_POST["captcha_word"], $_POST["captcha_sid"], false, $_POST["USER_PHONE_NUMBER"]);
  284. }
  285. if($_POST["TYPE"] == "AUTH" || $_POST["TYPE"] == "OTP")
  286. {
  287. //special login form in the control panel
  288. if($arAuthResult === true && defined('ADMIN_SECTION') && ADMIN_SECTION === true)
  289. {
  290. //store cookies for next hit (see CMain::GetSpreadCookieHTML())
  291. $GLOBALS["APPLICATION"]->StoreCookies();
  292. $kernelSession['BX_ADMIN_LOAD_AUTH'] = true;
  293. // die() follows
  294. CMain::FinalActions('<script type="text/javascript">window.onload=function(){(window.BX || window.parent.BX).AUTHAGENT.setAuthResult(false);};</script>');
  295. }
  296. }
  297. }
  298. $GLOBALS["APPLICATION"]->SetAuthResult($arAuthResult);
  299. }
  300. elseif(!$GLOBALS["USER"]->IsAuthorized() && isset($_REQUEST['bx_hit_hash']))
  301. {
  302. //Authorize by unique URL
  303. $GLOBALS["USER"]->LoginHitByHash($_REQUEST['bx_hit_hash']);
  304. }
  305. }
  306. //logout or re-authorize the user if something importand has changed
  307. $GLOBALS["USER"]->CheckAuthActions();
  308. //magic short URI
  309. if(defined("BX_CHECK_SHORT_URI") && BX_CHECK_SHORT_URI && CBXShortUri::CheckUri())
  310. {
  311. //local redirect inside
  312. die();
  313. }
  314. //application password scope control
  315. if(($applicationID = $GLOBALS["USER"]->GetParam("APPLICATION_ID")) !== null)
  316. {
  317. $appManager = \Bitrix\Main\Authentication\ApplicationManager::getInstance();
  318. if($appManager->checkScope($applicationID) !== true)
  319. {
  320. $event = new \Bitrix\Main\Event("main", "onApplicationScopeError", Array('APPLICATION_ID' => $applicationID));
  321. $event->send();
  322. CHTTP::SetStatus("403 Forbidden");
  323. die();
  324. }
  325. }
  326. //define the site template
  327. if(!defined("ADMIN_SECTION") || ADMIN_SECTION !== true)
  328. {
  329. $siteTemplate = "";
  330. if(isset($_REQUEST["bitrix_preview_site_template"]) && is_string($_REQUEST["bitrix_preview_site_template"]) && $_REQUEST["bitrix_preview_site_template"] <> "" && $GLOBALS["USER"]->CanDoOperation('view_other_settings'))
  331. {
  332. //preview of site template
  333. $signer = new Bitrix\Main\Security\Sign\Signer();
  334. try
  335. {
  336. //protected by a sign
  337. $requestTemplate = $signer->unsign($_REQUEST["bitrix_preview_site_template"], "template_preview".bitrix_sessid());
  338. $aTemplates = CSiteTemplate::GetByID($requestTemplate);
  339. if($template = $aTemplates->Fetch())
  340. {
  341. $siteTemplate = $template["ID"];
  342. //preview of unsaved template
  343. if(isset($_GET['bx_template_preview_mode']) && $_GET['bx_template_preview_mode'] == 'Y' && $GLOBALS["USER"]->CanDoOperation('edit_other_settings'))
  344. {
  345. define("SITE_TEMPLATE_PREVIEW_MODE", true);
  346. }
  347. }
  348. }
  349. catch(\Bitrix\Main\Security\Sign\BadSignatureException $e)
  350. {
  351. }
  352. }
  353. if($siteTemplate == "")
  354. {
  355. $siteTemplate = CSite::GetCurTemplate();
  356. }
  357. define("SITE_TEMPLATE_ID", $siteTemplate);
  358. define("SITE_TEMPLATE_PATH", getLocalPath('templates/'.SITE_TEMPLATE_ID, BX_PERSONAL_ROOT));
  359. }
  360. else
  361. {
  362. // prevents undefined constants
  363. define('SITE_TEMPLATE_ID', '.default');
  364. define('SITE_TEMPLATE_PATH', '/bitrix/templates/.default');
  365. }
  366. //magic parameters: show page creation time
  367. if(isset($_GET["show_page_exec_time"]))
  368. {
  369. if($_GET["show_page_exec_time"]=="Y" || $_GET["show_page_exec_time"]=="N")
  370. $kernelSession["SESS_SHOW_TIME_EXEC"] = $_GET["show_page_exec_time"];
  371. }
  372. //magic parameters: show included file processing time
  373. if(isset($_GET["show_include_exec_time"]))
  374. {
  375. if($_GET["show_include_exec_time"]=="Y" || $_GET["show_include_exec_time"]=="N")
  376. $kernelSession["SESS_SHOW_INCLUDE_TIME_EXEC"] = $_GET["show_include_exec_time"];
  377. }
  378. //magic parameters: show include areas
  379. if(isset($_GET["bitrix_include_areas"]) && $_GET["bitrix_include_areas"] <> "")
  380. $GLOBALS["APPLICATION"]->SetShowIncludeAreas($_GET["bitrix_include_areas"]=="Y");
  381. //magic sound
  382. if($GLOBALS["USER"]->IsAuthorized())
  383. {
  384. $cookie_prefix = COption::GetOptionString('main', 'cookie_name', 'BITRIX_SM');
  385. if(!isset($_COOKIE[$cookie_prefix.'_SOUND_LOGIN_PLAYED']))
  386. $GLOBALS["APPLICATION"]->set_cookie('SOUND_LOGIN_PLAYED', 'Y', 0);
  387. }
  388. //magic cache
  389. \Bitrix\Main\Composite\Engine::shouldBeEnabled();
  390. foreach(GetModuleEvents("main", "OnBeforeProlog", true) as $arEvent)
  391. ExecuteModuleEventEx($arEvent);
  392. if((!defined("NOT_CHECK_PERMISSIONS") || NOT_CHECK_PERMISSIONS!==true) && (!defined("NOT_CHECK_FILE_PERMISSIONS") || NOT_CHECK_FILE_PERMISSIONS!==true))
  393. {
  394. $real_path = $request->getScriptFile();
  395. if(!$GLOBALS["USER"]->CanDoFileOperation('fm_view_file', array(SITE_ID, $real_path)) || (defined("NEED_AUTH") && NEED_AUTH && !$GLOBALS["USER"]->IsAuthorized()))
  396. {
  397. /** @noinspection PhpUndefinedVariableInspection */
  398. if($GLOBALS["USER"]->IsAuthorized() && $arAuthResult["MESSAGE"] == '')
  399. {
  400. $arAuthResult = array("MESSAGE"=>GetMessage("ACCESS_DENIED").' '.GetMessage("ACCESS_DENIED_FILE", array("#FILE#"=>$real_path)), "TYPE"=>"ERROR");
  401. if(COption::GetOptionString("main", "event_log_permissions_fail", "N") === "Y")
  402. {
  403. CEventLog::Log("SECURITY", "USER_PERMISSIONS_FAIL", "main", $GLOBALS["USER"]->GetID(), $real_path);
  404. }
  405. }
  406. if(defined("ADMIN_SECTION") && ADMIN_SECTION==true)
  407. {
  408. if ($_REQUEST["mode"]=="list" || $_REQUEST["mode"]=="settings")
  409. {
  410. echo "<script>top.location='".$GLOBALS["APPLICATION"]->GetCurPage()."?".DeleteParam(array("mode"))."';</script>";
  411. die();
  412. }
  413. elseif ($_REQUEST["mode"]=="frame")
  414. {
  415. echo "<script type=\"text/javascript\">
  416. var w = (opener? opener.window:parent.window);
  417. w.location.href='".$GLOBALS["APPLICATION"]->GetCurPage()."?".DeleteParam(array("mode"))."';
  418. </script>";
  419. die();
  420. }
  421. elseif(defined("MOBILE_APP_ADMIN") && MOBILE_APP_ADMIN==true)
  422. {
  423. echo json_encode(Array("status"=>"failed"));
  424. die();
  425. }
  426. }
  427. /** @noinspection PhpUndefinedVariableInspection */
  428. $GLOBALS["APPLICATION"]->AuthForm($arAuthResult);
  429. }
  430. }
  431. //Do not remove this