Your IP : 3.133.108.47


Current Path : /var/www/www-root/data/www/monolith-realty.ru/bitrix/components/aspro/developer.allcorp3/
Upload File :
Current File : /var/www/www-root/data/www/monolith-realty.ru/bitrix/components/aspro/developer.allcorp3/ajax.php

<?
use Bitrix\Main\Loader,
    Bitrix\Main\Localization\Loc,
    Bitrix\Main\SystemException;

require_once($_SERVER['DOCUMENT_ROOT'] . SITE_TEMPLATE_PATH . '/vendor/php/solution.php'); 

if(!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) die();
Loc::loadMessages(__FILE__);

class DeveloperController extends \Bitrix\Main\Engine\Controller {
	public function configureActions(){
        return array(
            'getDeveloper' => array(
                'prefilters' => array(),
            ),
        );
    }

    public function getDeveloperAction($siteId, $lang, $signedParameters = ''){
    	$this->includeModules();

        $this->checkSite($siteId);

        $componentName = TSolution::partnerName.':developer.'.TSolution::solutionName;

        try{
	        $signer = new \Bitrix\Main\Component\ParameterSigner;
			$arParams = $signer->unsignParameters(str_replace(':', '.', $componentName), $signedParameters);
        }
        catch(\Bitrix\Main\Security\Sign\BadSignatureException $e){
			die();
		}

        $template = $arParams['COMPONENT_TEMPLATE'] ?: '';

        $arParams['CUSTOM_SITE_ID'] = $siteId;
        $arParams['CUSTOM_LANGUAGE_ID'] = $lang;

        $GLOBALS['APPLICATION']->RestartBuffer();

        $arResult = $GLOBALS['APPLICATION']->IncludeComponent(
			$componentName,
			$template,
			$arParams
		);

       \CMain::FinalActions();
        flush();
        die();
    }

    protected function includeModules(){
        if(!class_exists('TSolution') || !Loader::includeModule(TSolution::moduleID)){
            throw new SystemException(Loc::getMessage('WS_C_ERROR_MODULE_NOT_INSTALLED'));
        }
    }

    protected function checkSite($siteId){
        if(!$siteId){
            throw new SystemException(Loc::getMessage('DA_C_ERROR_BAD_SITE_PARAMS'));
        }
    }
}