/** * @return array */ public function getDefaultSocials() { $aResult = array(); $oSettings =& CApi::GetSettings(); $aSocials = $oSettings->GetConf('Socials'); if (isset($aSocials) && is_array($aSocials)) { $oPlugin = \CApi::Plugin()->GetPluginByName('external-services'); if ($oPlugin) { $aConnectors = $oPlugin->GetEnabledConnectors(); foreach ($aSocials as $sKey => $aSocial) { if (in_array(strtolower($sKey), $aConnectors)) { $oTenantSocial = CTenantSocials::initFromSettings($aSocial); if ($oTenantSocial !== null) { $aResult[strtolower($sKey)] = $oTenantSocial; } } } } } return $aResult; }
/** * @param string $sWhere * * @return string */ protected function getSocialByWhere($sWhere) { return api_AContainer::DbGetObjectSqlString($sWhere, $this->prefix() . 'awm_tenant_socials', CTenantSocials::getStaticMap(), $this->oHelper); }
/** * @param int $iIdTenant * @param string $sSocialName * * @return array | false */ public function GetSocialByName($iIdTenant, $sSocialName) { $oSocial = null; if ($this->oConnection->Execute($this->oCommandCreator->GetSocialByName($iIdTenant, $sSocialName))) { $oRow = $this->oConnection->GetNextRecord(); if ($oRow) { $oSocial = new CTenantSocials(); $oSocial->InitByDbRow($oRow); } $this->oConnection->FreeResult(); } $this->throwDbExceptionIfExist(); return $oSocial; }
/** * @return array */ public function GetDefaultSocials() { $aResult = array(); $oSettings =& CApi::GetSettings(); $aSocials = $oSettings->GetConf('Socials'); if (isset($aSocials) && is_array($aSocials)) { $aConnectors = CApi::GetConf('plugins.social-auth.connectors', array()); foreach ($aSocials as $sKey => $aSocial) { if (in_array(strtolower($sKey), $aConnectors)) { $oTenantSocial = CTenantSocials::InitFromSettings($aSocial); if ($oTenantSocial !== null) { $aResult[strtolower($sKey)] = $oTenantSocial; } } } } return $aResult; }