Beispiel #1
0
	public static function getDomainsList()
	{
		static $arDomains = null;

		if($arDomains === null)
		{
			$arDomains = array();

			$dbSites = Freetrix\Main\SiteDomainTable::getList(
				array(
					'select'=>array(
						'DOMAIN', 'LID',
						'SITE_NAME'=>'SITE.NAME', 'SITE_ACTIVE' => 'SITE.ACTIVE',
						'SITE_DIR' => 'SITE.DIR', 'SITE_DOC_ROOT' => 'SITE.DOC_ROOT'
					)
				)
			);

			$defaultDomain = CBXPunycode::ToASCII(Freetrix\Main\Config\Option::getRealValue('main', 'server_name'), $e = null);

			$bCurrentHostFound = false;
			while($arSite = $dbSites->fetch())
			{
				$arDomains[] = $arSite;
				if($arSite['DOMAIN'] == $defaultDomain)
					$bCurrentHostFound = true;
			}

			if(!$bCurrentHostFound)
			{
				$dbDefSite = Freetrix\Main\SiteTable::getList(array(
					'filter' => array('DEF' => 'Y'),
					'select' => array('LID', 'NAME', 'ACTIVE'),
				));
				$arDefSite = $dbDefSite->fetch();
				if($arDefSite)
				{
					array_unshift($arDomains, array(
						'DOMAIN' => $defaultDomain,
						'LID' => $arDefSite['LID'],
						'SITE_NAME' => $arDefSite['NAME'],
						'SITE_ACTIVE' => $arDefSite['ACTIVE'],
						'SITE_DIR' => $arDefSite['DIR'],
						'SITE_DOC_ROOT' => $arDefSite['DOC_ROOT'],
					));
				}
			}
		}

		return $arDomains;
	}
Beispiel #2
0
				$host = $rule[1];
				if(strncmp($host, 'https://', 8) === 0)
				{
					$host = substr($host, 8);
					$bDefaultHttps = true;
				}
				$arSite['DOMAINS'][] = $host;
			}
		}

		if($arSite['SERVER_NAME'] != '')
			$arSite['DOMAINS'][] = $arSite['SERVER_NAME'];

		$dbDomains = Freetrix\Main\SiteDomainTable::getList(
			array(
				'filter' => array('LID' => $SITE_ID),
				'select'=>array('DOMAIN')
			)
		);
		while($arDomain = $dbDomains->fetch())
		{
			$arSite['DOMAINS'][] = $arDomain['DOMAIN'];
		}
		$arSite['DOMAINS'][] = \Freetrix\Main\Config\Option::get('main', 'server_name', '');
		$arSite['DOMAINS'] = array_unique($arSite['DOMAINS']);
	}
}

if(strlen($SITE_ID) <= 0)
{
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_after.php");
	ShowError(Loc::getMessage("SEO_ERROR_SITEMAP_NO_SITE"));