%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 18.117.188.67
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64
User : www-root ( 1010)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/www-root/data/www/dev.artlot24.ru/bitrix/components/bitrix/iblock.element.selector/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/components/bitrix/iblock.element.selector//ajax.php
<?php
define('STOP_STATISTICS', true);
define('NO_AGENT_CHECK', true);
define('DisableEventsCheck', true);
define('BX_SECURITY_SHOW_MESSAGE', true);

//todo move this ajax handler to component class

require_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_before.php');
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();

if(!check_bitrix_sessid() || !CModule::includeModule('iblock'))
{
	require_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/epilog_after.php');
	die();
}

global $APPLICATION;

$elements = array();

switch($_REQUEST['mode'])
{
	case 'search':
	{
		CUtil::JSPostUnescape();
		$APPLICATION->RestartBuffer();

		$minPermission = 'R';
		if (isset($_REQUEST['admin']) && is_string($_REQUEST['admin']))
		{
			if ($_REQUEST['admin'] == 'Y')
				$minPermission = 'S';
		}

		$searchString = trim($_REQUEST['string']);
		$filter = array(
			'CHECK_PERMISSIONS' => 'Y',
			'MIN_PERMISSION' => $minPermission
		);
		$iblockId = 0;
		if (isset($_REQUEST['iblockId']) && is_string($_REQUEST['iblockId']))
			$iblockId = (int)$_REQUEST['iblockId'];
		if ($iblockId > 0)
			$filter['IBLOCK_ID'] = $iblockId;
		if(is_numeric($searchString))
		{
			$filter['=ID'] = intval($searchString);
		}
		else
		{
			$filter['?NAME'] = $searchString;
		}

		$queryElementObject = CIBlockElement::GetList(
			['NAME' => 'ASC'], $filter, false, false, ['ID', 'IBLOCK_ID', 'NAME', 'IBLOCK_SECTION_ID']);
		while ($element = $queryElementObject->fetch())
		{
			$url = '';
			if (!empty($_REQUEST['template_url']))
			{
				$socnetGroupId = null;
				$queryIblockObject = \CIBlock::getList([], ['ID' => $element['IBLOCK_ID'], 'CHECK_PERMISSIONS' => 'N']);
				while ($iblock = $queryIblockObject->fetch())
				{
					$socnetGroupId = $iblock['SOCNET_GROUP_ID'];
				}

				$sectionId = $element['IBLOCK_SECTION_ID'] ?: 0;
				$socnetGroupId = $socnetGroupId ?: 0;

				$url = str_replace(
					['#list_id#', '#section_id#', '#element_id#', '#group_id#'],
					[$element['IBLOCK_ID'], $sectionId, $element['ID'], $socnetGroupId],
					$_REQUEST['template_url']
				);
			}

			$elements[] = [
				'ID' => $element['ID'],
				'NAME' => '['.$element['ID'].'] '.$element['NAME'],
				'URL' => $url,
			];
		}

		break;
	}
}

header('Content-Type: application/json');
echo \Bitrix\Main\Web\Json::encode(array_values(array_filter($elements)));
require_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/epilog_after.php');
die();

Youez - 2016 - github.com/yon3zu
LinuXploit