AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.135.195.169
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/bitrix/modules/mobileapp/install/services/mobileapp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/modules/mobileapp/install/services/mobileapp/jn.php
<?php

use Bitrix\Main\Engine\JsonPayload;
use Bitrix\Main\Loader;
use Bitrix\MobileApp\Janative\Entity\Extension;
use Bitrix\MobileApp\Janative\Manager;

define('NOT_CHECK_PERMISSIONS', true);
require_once($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php');

/** @var CAllMain $APPLICATION */

$types = ["component", "extension"];
$componentName = $_GET['componentName'] ?? null;
$namespace = $_GET['namespace'] ?? null;
$version = $_REQUEST['version'] ?? null;
$type = $_REQUEST['type'] ?? null;
$type = ($type && in_array($type, $types, true) ? $type : "component");
if (isset($_REQUEST["reload"]))
{
	define("JN_DEV_RELOAD", true);
}

Loader::includeModule("mobileapp");

if ($type == "component")
{
	$APPLICATION->IncludeComponent('bitrix:mobileapp.jnrouter', '', [
		'componentName' => $componentName,
		'namespace' => $namespace,
		'clientVersion' => $version,
		'checkVersion' => isset($_REQUEST['check']),
		'needAuth' => true,
	], null, ['HIDE_ICONS' => 'Y']);
}
else
{
	header('Content-Type: text/javascript;charset=UTF-8');
	try
	{
		$extension = new Extension($componentName);
		$deps = $extension->getDependencies();
		$payload = new JsonPayload();
		if (!empty($payload->getRaw()))
		{
			$exclude = $payload->getData();
			if (!empty($exclude) && is_array($exclude))
			{
				$deps = array_diff($deps, $exclude);
			}
		}

		$content = "";
		$langExpression = "";
		foreach ($deps as $name)
		{
			$item = new Extension($name);
			$langExpression .= $item->getLangDefinitionExpression();
			$content .= $item->getContent();
		}
		header('BX-Extension: true');
		$result = "$langExpression\n$content";
		$componentDeps = $extension->getComponentDependencies();
		if ($componentDeps !== null) {
			$allComponents = Manager::getAvailableComponents();
			$data = array_map(function ($component) {
				return $component->getInfo();
			}, array_intersect_key($allComponents, array_flip($componentDeps)));
			$jsonData = json_encode($data);
			$updateComponentsExpression = "\nthis.availableComponents = { ... this.availableComponents, ... $jsonData };\n";
			$result = "$updateComponentsExpression\n$result";
		}


		echo $result;
	}
	catch (Exception $e)
	{
		$error = escapePHPString($e->getMessage(), "'");
		header('BX-Extension:false');
		echo "console.error('$error')";
	}
}

\CMain::FinalActions();


Anon7 - 2022
AnonSec Team