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/pull/lib/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/pull/lib/pushsmartfilter.php
<?php
namespace Bitrix\Pull;

use Bitrix\Main\Config\Option;

class PushSmartfilter
{
	public static function getStatus($userId = null)
	{
		if (!\CPullOptions::GetPushStatus())
		{
			return null;
		}

		if (is_null($userId) && is_object($GLOBALS['USER']))
		{
			$userId = $GLOBALS['USER']->getId();
		}
		$userId = intval($userId);
		if (!$userId)
		{
			return false;
		}

		$isSmartFilterDisabledByDefault =  Option::get('pull', 'is_smartfilter_disabled_by_default', 'N') === 'Y';
		if ($isSmartFilterDisabledByDefault)
		{
			return (bool)\CUserOptions::GetOption('pull', 'push_smartfilter_status_v2', false, $userId);
		}

		return (bool)\CUserOptions::GetOption('pull', 'push_smartfilter_status', true, $userId);
	}

	public static function setStatus($status, $userId = null)
	{
		if (!\CPullOptions::GetPushStatus())
		{
			return null;
		}

		if (is_null($userId) && is_object($GLOBALS['USER']))
		{
			$userId = $GLOBALS['USER']->getId();
		}
		$userId = intval($userId);
		if (!$userId)
		{
			return false;
		}

		$status = $status === false? false: true;

		$isSmartFilterDisabledByDefault =  Option::get('pull', 'is_smartfilter_disabled_by_default', 'N') === 'Y';
		if ($isSmartFilterDisabledByDefault)
		{
			return (bool)\CUserOptions::SetOption('pull', 'push_smartfilter_status_v2', $status, false, $userId);
		}

		return (bool)\CUserOptions::SetOption('pull', 'push_smartfilter_status', $status, false, $userId);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit