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/lists.user.processes/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/components/bitrix/lists.user.processes/ajax.php
<?php

use Bitrix\Lists\Internals\Error\Error;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\Loader;
use Bitrix\Lists\Internals\Controller;

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

if (!Loader::IncludeModule('lists') || !\Bitrix\Main\Application::getInstance()->getContext()->getRequest()->getQuery('action'))
{
	return;
}

Loc::loadMessages(__FILE__);

class ProcessesAjaxController extends Controller
{
	/** @var  string */
	protected $iblockTypeId;
	protected $listPerm;

	protected function listOfActions()
	{
		return array(
			'showProcesses' => array(
				'method' => array('POST'),
			),
		);
	}

	protected function processActionShowProcesses()
	{
		$this->iblockTypeId = COption::GetOptionString("lists", "livefeed_iblock_type_id");
		$this->checkPermission();
		if($this->errorCollection->hasErrors())
		{
			$this->sendJsonErrorResponse();
		}

		$siteDir = '/';
		$siteId = true;
		if($this->request->getPost('siteDir'))
			$siteDir = $this->request->getPost('siteDir');
		if($this->request->getPost('siteId'))
			$siteId = $this->request->getPost('siteId');

		$path = rtrim($siteDir, '/');

		$listData = array();
		$lists = CIBlock::getList(
			array("SORT" => "ASC","NAME" => "ASC"),
			array("ACTIVE" => "Y","TYPE" => $this->iblockTypeId, "SITE_ID" => $siteId)
		);
		while($list = $lists->fetch())
		{
			if(CLists::getLiveFeed($list['ID']))
			{
				$listData[$list['ID']]['name'] = $list['NAME'];
				$listData[$list['ID']]['url'] = $path.COption::GetOptionString('lists', 'livefeed_url').'?livefeed=y&list_id='.$list["ID"].'&element_id=0';
				if($list['PICTURE'] > 0)
				{
					$imageFile = CFile::GetFileArray($list['PICTURE']);
					if($imageFile !== false)
					{
						$imageFile = CFile::ResizeImageGet(
							$imageFile,
							array("width" => 36, "height" => 30),
							BX_RESIZE_IMAGE_PROPORTIONAL,
							false
						);
						$listData[$list['ID']]['picture'] = '<img src="'.$imageFile["src"].'" width="19" height="16" border="0" />';
					}
				}
				else
				{
					$listData[$list['ID']]['picture'] = '<img src="/bitrix/images/lists/default.png" width="19" height="16" border="0" />';
				}
			}
		}

		if(!empty($listData))
		{
			$this->sendJsonSuccessResponse(
				array(
					'lists' => $listData
				)
			);
		}
		else
		{
			$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_SEAC_NOT_PROCESSES'))));
			$this->sendJsonErrorResponse();
		}
	}

	protected function checkPermission()
	{
		$this->listPerm = CListPermissions::checkAccess(
			$this->getUser(),
			$this->iblockTypeId
		);
		if($this->listPerm < 0)
		{
			switch($this->listPerm)
			{
				case CListPermissions::WRONG_IBLOCK_TYPE:
					$this->errorCollection->add(array(new Error(Loc::getMessage('CC_BLL_WRONG_IBLOCK_TYPE'))));
					break;
				case CListPermissions::WRONG_IBLOCK:
					$this->errorCollection->add(array(new Error(Loc::getMessage('CC_BLL_WRONG_IBLOCK'))));
					break;
				case CListPermissions::LISTS_FOR_SONET_GROUP_DISABLED:
					$this->errorCollection->add(array(new Error(Loc::getMessage('CC_BLL_LISTS_FOR_SONET_GROUP_DISABLED'))));
					break;
				default:
					$this->errorCollection->add(array(new Error(Loc::getMessage('CC_BLL_UNKNOWN_ERROR'))));
					break;
			}
		}
		elseif($this->listPerm <= CListPermissions::ACCESS_DENIED)
		{
			$this->errorCollection->add(array(new Error(Loc::getMessage('CC_BLL_ACCESS_DENIED'))));
		}
	}
}

$controller = new ProcessesAjaxController();
$controller
	->setActionName(\Bitrix\Main\Application::getInstance()->getContext()->getRequest()->getQuery('action'))
	->exec();

Youez - 2016 - github.com/yon3zu
LinuXploit