• Модуль: forum
  • Путь к файлу: ~/bitrix/modules/forum/classes/general/user.php
  • Класс: CAllForumUser
  • Вызов: CAllForumUser::IsLocked
static function IsLocked($userID)
{
	$userID = (int) $userID;
	if ($userID <= 0)
	{
		return false;
	}

	$cacheID = 'b_forum_user_locked_' . $userID;
	$cache = BitrixMainApplication::getInstance()->getManagedCache();

	if (CACHED_b_forum_user !== false && $cache->read(CACHED_b_forum_user, $cacheID, 'b_forum_user'))
	{
		$result = $cache->get($cacheID);
	}
	else
	{
		$allow = BitrixForumUserTable::query()
			->addSelect('ALLOW_POST')
			->where('USER_ID', $userID)
			->fetch();

		if ($allow)
		{
			$result = $allow['ALLOW_POST'];
		}
		else
		{
			$result = 'Y';
		}

		$cache->set($cacheID, $result);
	}

	return $result != 'Y';
}