require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_before.php"); require_once($_SERVER["DOCUMENT_ROOT"].FX_ROOT."/modules/main/prolog.php"); if (!$USER->CanDoOperation('seo_tools')) die(GetMessage("ACCESS_DENIED")); use Freetrix\Seo\Engine; use Freetrix\Main\IO\Path; IncludeModuleLangFile(__FILE__); \Freetrix\Main\Loader::includeModule('seo'); \Freetrix\Main\Loader::includeModule('socialservices'); CUtil::JSPostUnescape(); $engine = new Engine\Google(); if(isset($_REQUEST['action']) && check_freetrix_sessid()) { $res = array(); $arDomain = null; if(isset($_REQUEST['domain']) && strlen($_REQUEST['domain']) > 0) { $bFound = false; $arDomains = \CSeoUtils::getDomainsList(); foreach($arDomains as $arDomain) { if($arDomain['DOMAIN'] == $_REQUEST['domain'] && rtrim($arDomain['SITE_DIR'], '/') == rtrim($_REQUEST['dir'], '/')) { $bFound = true;
} if(!$bFound) $domain = false; } if(!$domain) { require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_after.php"); ShowError(Loc::getMessage("SEO_ERROR_NO_DOMAIN")); require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_admin.php"); } $APPLICATION->SetAdditionalCSS('/freetrix/panel/seo/seo.css'); $engine = new Engine\Google(); $siteDomainEnc = Converter::getHtmlConverter()->encode($arDomain['DOMAIN']); $siteDomainEncView = Converter::getHtmlConverter()->encode(\CBXPunycode::ToUnicode($arDomain['DOMAIN'], $e = null)); $siteDirEnc = Converter::getHtmlConverter()->encode($arDomain['SITE_DIR']); try { $arSiteInfo = $engine->getSiteInfo($arDomain['DOMAIN'], $arDomain['SITE_DIR']); } catch(Exception $e) { require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_after.php"); ShowError($e->getMessage()); require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_admin.php"); }
if(!Main\Loader::includeModule('seo')) { require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_after.php"); ShowError(Loc::getMessage("SEO_ERROR_NO_MODULE")); require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_admin.php"); } if(!Main\Loader::includeModule('socialservices')) { require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_after.php"); ShowError(Loc::getMessage("SEO_ERROR_NO_MODULE_SOCSERV")); require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_admin.php"); } $strError = ""; $engine = new Engine\Google(); if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_REQUEST['CODE']) && check_freetrix_sessid()) { try { $engine->getAuth($_REQUEST['CODE']); LocalRedirect($APPLICATION->GetCurPageParam('oauth=yes', array('CODE', 'oauth'))); } catch (Exception $e) { $strError = Loc::getMessage('SEO_ERROR_GET_ACCESS', array("#ERROR_TEXT#" => $e->getMessage())); } } $sTableID = "tbl_seo_domains";