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/sender.rc.list/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/components/bitrix/sender.rc.list/ajax.php
<?php
define('STOP_STATISTICS', true);
define('BX_SECURITY_SHOW_MESSAGE', true);

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

use Bitrix\Main\HttpRequest;
use Bitrix\Sender\Entity;
use Bitrix\Sender\Internals\CommonAjax;
use Bitrix\Sender\Internals\QueryController as Controller;
use Bitrix\Sender\Security;

if (!Bitrix\Main\Loader::includeModule('sender'))
{
	return;
}

$writeChecker = CommonAjax\Checker::getModifyRcPermissionChecker();
$pauseStartStopChecker = CommonAjax\Checker::getPauseStopStartRcPermissionChecker();

$actions = array();
$actions[] = Controller\Action::create('send')->setHandler(
	function (HttpRequest $request, Controller\Response $response)
	{
		$letter = new Entity\Rc($request->get('id'));
		$userId = Security\User::current()->getId();
		if ($userId)
		{
			$letter->set('UPDATED_BY', $userId);
		}
		$letter->send();

		$content = $response->initContentJson();
		$content->getErrorCollection()->add($letter->getErrors());
	}
)->setCheckers(array($pauseStartStopChecker));
$actions[] = Controller\Action::create('pause')->setHandler(
	function (HttpRequest $request, Controller\Response $response)
	{
		$letter = new Entity\Rc($request->get('id'));
		$userId = Security\User::current()->getId();
		if ($userId)
		{
			$letter->set('UPDATED_BY', $userId);
		}
		$letter->pause();

		$content = $response->initContentJson();
		$content->getErrorCollection()->add($letter->getErrors());
	}
)->setCheckers(array($pauseStartStopChecker));
$actions[] = Controller\Action::create('resume')->setHandler(
	function (HttpRequest $request, Controller\Response $response)
	{
		$letter = new Entity\Rc($request->get('id'));
		$userId = Security\User::current()->getId();
		if ($userId)
		{
			$letter->set('UPDATED_BY', $userId);
		}
		$letter->resume();

		$content = $response->initContentJson();
		$content->getErrorCollection()->add($letter->getErrors());
	}
)->setCheckers(array($pauseStartStopChecker));
$actions[] = Controller\Action::create('wait')->setHandler(
	function (HttpRequest $request, Controller\Response $response)
	{
		$letter = new Entity\Rc($request->get('id'));
		$userId = Security\User::current()->getId();
		if ($userId)
		{
			$letter->set('UPDATED_BY', $userId);
		}
		$letter->wait();

		$content = $response->initContentJson();
		$content->getErrorCollection()->add($letter->getErrors());
	}
)->setCheckers(array($pauseStartStopChecker));
$actions[] = Controller\Action::create('halt')->setHandler(
	function (HttpRequest $request, Controller\Response $response)
	{
		$letter = new Entity\Rc($request->get('id'));
		$userId = Security\User::current()->getId();
		if ($userId)
		{
			$letter->set('UPDATED_BY', $userId);
		}
		$letter->halt();

		$content = $response->initContentJson();
		$content->getErrorCollection()->add($letter->getErrors());
	}
)->setCheckers(array($pauseStartStopChecker));
$actions[] = Controller\Action::create('stop')->setHandler(
	function (HttpRequest $request, Controller\Response $response)
	{
		$letter = new Entity\Rc($request->get('id'));
		$userId = Security\User::current()->getId();
		if ($userId)
		{
			$letter->set('UPDATED_BY', $userId);
		}
		$letter->stop();

		$content = $response->initContentJson();
		$content->getErrorCollection()->add($letter->getErrors());
	}
)->setCheckers(array($pauseStartStopChecker));
$actions[] = Controller\Action::create('remove')->setHandler(
	function (HttpRequest $request, Controller\Response $response)
	{
		$letter = new Entity\Rc($request->get('id'));
		$userId = Security\User::current()->getId();
		if ($userId)
		{
			$letter->set('UPDATED_BY', $userId);
		}
		$letter->remove();

		$content = $response->initContentJson();
		$content->getErrorCollection()->add($letter->getErrors());
	}
)->setCheckers(array($writeChecker));
$actions[] = Controller\Action::create('copy')->setHandler(
	function (HttpRequest $request, Controller\Response $response)
	{
		$letter = new Entity\Rc($request->get('id'));
		$userId = Security\User::current()->getId();
		if ($userId)
		{
			$letter->set('UPDATED_BY', $userId);
		}
		$copiedId = $letter->copy();

		$content = $response->initContentJson();
		$content->add('id', $letter->getId());
		$content->add('copiedId', $copiedId);
		$content->getErrorCollection()->add($letter->getErrors());
	}
)->setCheckers(array($writeChecker));
$actions[] = Controller\Action::create('acceptAgreement')->setHandler(
	function (HttpRequest $request, Controller\Response $response)
	{
		if (!Security\Agreement::acceptByCurrentUser())
		{
			$response->initContentJson()->addError('');
		}
	}
);

$readChecker = CommonAjax\Checker::getViewRcPermissionChecker();
Controller\Listener::create()->addChecker($readChecker)->setActions($actions)->run();

Youez - 2016 - github.com/yon3zu
LinuXploit