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/main/lib/mail/internal/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/main/lib/mail/internal/sendertable.php
<?php

namespace Bitrix\Main\Mail\Internal;

use Bitrix\Main\Entity;
use Bitrix\Main\Config;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\Security;
use Bitrix\Main\ORM\Fields;

/**
 * Class SenderTable
 * @package Bitrix\Main\Mail\Internal
 *
 * DO NOT WRITE ANYTHING BELOW THIS
 *
 * <<< ORMENTITYANNOTATION
 * @method static EO_Sender_Query query()
 * @method static EO_Sender_Result getByPrimary($primary, array $parameters = [])
 * @method static EO_Sender_Result getById($id)
 * @method static EO_Sender_Result getList(array $parameters = [])
 * @method static EO_Sender_Entity getEntity()
 * @method static \Bitrix\Main\Mail\Internal\Sender createObject($setDefaultValues = true)
 * @method static \Bitrix\Main\Mail\Internal\EO_Sender_Collection createCollection()
 * @method static \Bitrix\Main\Mail\Internal\Sender wakeUpObject($row)
 * @method static \Bitrix\Main\Mail\Internal\EO_Sender_Collection wakeUpCollection($rows)
 */
class SenderTable extends Entity\DataManager
{

	public static function getTableName()
	{
		return 'b_main_mail_sender';
	}

	public static function add(array $data)
	{
		$result = parent::add($data);

		\Bitrix\Main\Mail\Sender::clearCustomSmtpCache($data['EMAIL']);

		return $result;
	}


	public static function getObjectClass()
	{
		return Sender::class;
	}

	// @TODO: invalidate smtp cache on update and delete

	public static function getMap()
	{
		return [
			(new Fields\IntegerField("ID"))
				->configurePrimary(true)
				->configureAutocomplete(true)
				->configureTitle(Loc::getMessage("main_mail_sender_id_title")),

			(new Fields\StringField("EMAIL"))
				->configureRequired(true)
				->configureTitle(Loc::getMessage("main_mail_sender_email_title")),

			(new Fields\StringField("NAME"))
				->configureTitle(Loc::getMessage("main_mail_sender_name_title")),

			(new Fields\IntegerField("USER_ID"))
				->configureAutocomplete(true)
				->configureTitle(Loc::getMessage("main_mail_sender_user_id_title")),

			(new Fields\BooleanField("IS_CONFIRMED"))
				->configureStorageValues("0", "1")
				->configureDefaultValue("0")
				->configureTitle(Loc::getMessage("main_mail_sender_is_confirmed_title")),

			(new Fields\BooleanField("IS_PUBLIC"))
				->configureStorageValues("0", "1")
				->configureDefaultValue("0")
				->configureTitle(Loc::getMessage("main_mail_sender_is_public_title")),

			(new Fields\ArrayField("OPTIONS"))
				->configureSerializationPhp()
				->configureRequired(false)
				->configureTitle(Loc::getMessage("main_mail_sender_options_title"))
				->addSaveDataModifier(function($value)
					{
						$value = unserialize($value, ['allowed_classes' => false]);
						if (!empty($value['smtp']['password']))
						{
							$value['smtp']['encrypted'] = false;

							$cryptoOptions = Config\Configuration::getValue('crypto');
							if (!empty($cryptoOptions['crypto_key']))
							{
								try
								{
									$cipher = new Security\Cipher();

									$value['smtp']['password'] = $cipher->encrypt(
										$value['smtp']['password'],
										$cryptoOptions['crypto_key']
									);
									$value['smtp']['encrypted'] = true;
								}
								catch (Security\SecurityException $e)
								{
								}
							}

							$value['smtp']['password'] = base64_encode($value['smtp']['password']);
						}

						return serialize($value);
					})
				->addFetchDataModifier(function($value)
				{
					if (!empty($value['smtp']['password']))
					{
						$value['smtp']['password'] = base64_decode($value['smtp']['password']);

						if (!empty($value['smtp']['encrypted']))
						{
							$cryptoOptions = Config\Configuration::getValue('crypto');
							if (!empty($cryptoOptions['crypto_key']))
							{
								try
								{
									$cipher = new Security\Cipher();

									$value['smtp']['password'] = $cipher->decrypt(
										$value['smtp']['password'],
										$cryptoOptions['crypto_key']
									);
									unset($value['smtp']['encrypted']);
								} catch (Security\SecurityException $e)
								{
								}
							}
						}
					}

					if (!empty($value['smtp']) && is_array($value['smtp']))
					{
						if (empty($value['smtp']['protocol']))
						{
							if (465 == $value['smtp']['port'])
							{
								$value['smtp']['protocol'] = 'smtps';
							} else if (587 == $value['smtp']['port'])
							{
								$value['smtp']['protocol'] = 'smtp';
							}
						}
					}

					return $value;
				}),
			(new Fields\StringField('PARENT_MODULE_ID'))
				->configureDefaultValue('main')
				->configureSize(50),
			(new Fields\IntegerField('PARENT_ID'))
				->configureNullable(),
		];
	}

}

Youez - 2016 - github.com/yon3zu
LinuXploit