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/cvetdv.ru/bitrix/modules/yandex.market/lib/ui/trading/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/yandex.market/lib/ui/trading/buyerprofileedit.php
<?php

namespace Yandex\Market\Ui\Trading;

use Bitrix\Main;
use Yandex\Market;

Main\Localization\Loc::loadMessages(__FILE__);

class BuyerProfileEdit extends Market\Ui\Reference\Page
{
	public function show()
	{
		$environment = Market\Trading\Entity\Manager::createEnvironment();
		$profileType = $environment->getProfile();
		$profileId = $this->getProfileId();

		if ($profileId === null)
		{
			$userId = $this->getUserId();
			$personTypeId = $this->getPersonTypeId();
			$service = $this->getService();
			$serviceValues = $service->getInfo()->getProfileValues();

			$profileId = $profileType->createProfile($userId, $personTypeId, $serviceValues);
		}

		$editUrl = $profileType->getEditUrl($profileId);

		if ($editUrl === null)
		{
			$message = Market\Config::getLang('ADMIN_TRADING_BUYER_PROFILE_EDIT_NO_EDIT_URL');
			throw new Main\SystemException($message);
		}

		LocalRedirect($editUrl);
	}

	protected function getUserId()
	{
		$result = (string)$this->request->getQuery('userId');

		if ($result === '')
		{
			$message = Market\Config::getLang('ADMIN_TRADING_BUYER_PROFILE_EDIT_NOT_SET_USER_ID');

			throw new Main\ArgumentException($message);
		}

		return $result;
	}

	protected function getPersonTypeId()
	{
		$result = (string)$this->request->getQuery('personType');

		if ($result === '')
		{
			$message = Market\Config::getLang('ADMIN_TRADING_BUYER_PROFILE_EDIT_NOT_SET_PERSON_TYPE');

			throw new Main\ArgumentException($message);
		}

		return $result;
	}

	protected function getService()
	{
		$code = $this->getServiceCode();

		return Market\Trading\Service\Manager::createProvider($code);
	}

	protected function getServiceCode()
	{
		$result = (string)$this->request->getQuery('service');

		if ($result === '')
		{
			$message = Market\Config::getLang('ADMIN_TRADING_BUYER_PROFILE_EDIT_NOT_SET_SERVICE');

			throw new Main\ArgumentException($message);
		}

		return $result;
	}

	protected function getProfileId()
	{
		$result = (string)$this->request->getQuery('id');

		if ($result === '')
		{
			$result = null;
		}

		return $result;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit