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(); } }
public function __construct() { if (!is_array(self::$arAuthServices)) { self::$arAuthServices = array(); $db_events = GetModuleEvents("socialservices", "OnAuthServicesBuildList"); while ($arEvent = $db_events->Fetch()) { $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); } }