• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/integration/ui/entityselector/userprovider.php
  • Класс: BitrixSocialnetworkIntegrationUIEntitySelectorUserProvider
  • Вызов: UserProvider::getUserType
static function getUserType(EO_User $user): string
{
	$type = null;
	if (!$user->getActive())
	{
		$type = 'inactive';
	}
	else if ($user->getExternalAuthId() === 'email')
	{
		$type = 'email';
	}
	else if ($user->getExternalAuthId() === 'replica')
	{
		$type = 'network';
	}
	else if (!in_array($user->getExternalAuthId(), UserTable::getExternalUserTypes()))
	{
		if (ModuleManager::isModuleInstalled('intranet'))
		{
			if (self::isIntegrator($user->getId()))
			{
				$type = 'integrator';
			}
			else
			{
				$ufDepartment = $user->getUfDepartment();
				if (
					empty($ufDepartment)
					|| (is_array($ufDepartment) && count($ufDepartment) === 1 && (int)$ufDepartment[0] === 0)
				)
				{
					$type = 'extranet';
				}
				else
				{
					$type = 'employee';
				}
			}
		}
		else
		{
			$type = 'user';
		}
	}
	else
	{
		$type = 'unknown';
	}

	return $type;
}