403Webshell
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/components/bitrix/mobileapp.jnrouter/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/components/bitrix/mobileapp.jnrouter/class.php
<?php

use Bitrix\MobileApp\Janative\Entity\Component;

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true)
{
	die();
}

/**
 * Class MobileJSComponent
 */
class JNRouterComponent extends \CBitrixComponent
{
	const VERSION = "1";

	private $name;
	private $namespace;

	public function onPrepareComponentParams($arParams)
	{
		if ($arParams["componentName"])
		{
			$componentName = $arParams["componentName"];
			$namespace = $arParams["namespace"];
			if (!$namespace)
			{
				if (mb_strpos($componentName, ":") > 0)
				{
					list($namespace, $componentName) = explode(":", $componentName);
				}
				else
				{
					$namespace = "bitrix";
				}
			}

			$this->namespace = $namespace;
			$this->name = $componentName;
		}

		return $arParams;
	}

	/**
	 * @return mixed|void
	 * @throws \Bitrix\Main\LoaderException
	 * @throws Exception
	 */
	public function executeComponent()
	{
		global $USER;

		if(!$USER->isAuthorized() && $this->arParams["needAuth"] === true)
		{
			$USER->LoginByHttpAuth();
		}

		if(!$USER->isAuthorized())
		{
			header("HTTP/1.0 401 Not Authorized");
			header('WWW-Authenticate: Basic realm="Bitrix24"');
			header("Content-Type: application/json");
			header("BX-Authorize: ".bitrix_sessid());
			echo \Bitrix\Main\Web\Json::encode([
				"status" => "failed",
				"bitrix_sessid"=>bitrix_sessid()
			]);
			\CMain::FinalActions();
		}

		\Bitrix\Main\Loader::includeModule("mobileapp");
		$component = Component::createInstanceByName($this->name, $this->namespace);
		header('Content-Type: text/javascript;charset=UTF-8');
		if ($component == null)
		{
			header("BX-Component-Not-Found: true");
			echo <<<JS
console.warn("Component not found");
JS;
		}
		else
		{
			if($this->arParams["checkVersion"])
			{
				if($this->arParams["clientVersion"] == $component->getVersion())
				{
					\CHTTP::SetStatus("304 Not Modified");
					return;
				}
			}

			$resultOnly = array_key_exists("get_result", $_REQUEST);
			$component->execute($resultOnly);
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit