• Модуль: socialservices
  • Путь к файлу: ~/bitrix/modules/socialservices/classes/general/authmanager.php
  • Класс: CSocServAuth
  • Вызов: CSocServAuth::__construct
public function __construct($userId = null)
{
	global $USER;

	if(!is_array(self::$arAuthServices))
	{
		self::$arAuthServices = array();

		foreach(GetModuleEvents("socialservices", "OnAuthServicesBuildList", true) as $arEvent)
		{
			$res = ExecuteModuleEventEx($arEvent);
			if(is_array($res))
			{
				if(!is_array($res[0]))
				{
					$res = array($res);
				}
				foreach($res as $serv)
				{
					self::$arAuthServices[$serv["ID"]] = $serv;
				}
			}
		}
		//services depend on current site
		$suffix = CSocServAuth::OptionsSuffix();
		self::$arAuthServices = self::AppyUserSettings($suffix);
	}

	$this->userId = $userId;
	if($this->userId === null && is_object($USER))
	{
		$this->userId = $USER->GetID();
	}
}