contenedor ( 'NAVControllerNewsletters'.$edi.'.tpl', DIR_PRIVATE_MEDIO . 'NAV/templates/', DIR_RW_MEDIO . '/pres/NAV' ); $this->setHeader ( 'NAVHeaderNewsletters'.$edi.'.tpl', DIR_PRIVATE_MEDIO . 'NAV/templates/', DIR_RW_MEDIO . '/pres/NAV' ); $this->setFoot ( 'NAVFootNewsletters'.$edi.'.tpl', DIR_PRIVATE_MEDIO . 'NAV/templates/', DIR_RW_MEDIO . '/pres/NAV' ); $this->salida = new SUSNWEscaparateOU(); parent::__construct(false,false,false); } public function inicio(){ $isSecure = $this->checkDomain(); $isSecure = $this->checkDomain(); $this->setDtmDataLayer([ 'primaryCat' => 'registro', 'subCat1' => 'registro>newsletter', 'subCat2' => 'registro>newsletter>escaparate', 'pageType' => 'otros', 'siteID' => 'los40com/registro', 'cms' => 'usun' ]); if ($isSecure) $this->addCss('/css/estilos.css'); else $this->addCss(DOMINIO_SEGURO.'/css/estilos.css'); $this->addScript("js/jquery-2.1.4.min.js"); $this->addScript("js/jquery-ui.min.js"); $this->content = $this->salida->getOutput(); if ($this->addHeaderJS) $this->addAllJS(); } public function run(){ $this->inicio(); $this->paintUpperHeader(); $this->paintContent($this->content); $this->end(); } public function end(){ } public function addAllCSS(){ $css = $this->salida->getCSS(); if (empty($css)) return; foreach ($css as $route => $show){ if ($show) $this->addCss($route); } } public function addAllJS(){ $jss = $this->salida->getJS(); if (empty($jss)) return; foreach ($jss as $route => $show){ if ($show) $this->addScript($route); } } private function checkDomain(){ // almacenamos los parámetros que nos lleguen por la url $extra = (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) ? '?' . $_SERVER['QUERY_STRING'] : ''; if (getenv('APPLICATION_ENV') == 'pro'){ $isSecure = ($_SERVER['SERVER_NAME'] == 'usuarios.los40.com') ? FALSE : TRUE; } else { $isSecure = ($_SERVER['REQUEST_URI'] == '/usuarios/newsletters/'.$extra) ? FALSE : TRUE; } /* CAMBIO 05/07/2019 :: se quita el dominio no seguro. Se redirige a dominio seguro en caso de acceso a dominio no seguro if ($this->salida->resVerify && !$isSecure){ // usuario logueado --> redirigimos a escaparate seguro header('Location: ' . URL_SUS_NEWS . $extra); exit; } else if (!$this->salida->resVerify && $isSecure){ // usuario no logueado --> redirigimos a escaparate no seguro header('Location: '.URL_SUS_NEWS_NOSECURE . $extra); exit; } */ if (!$isSecure){ //acceso a escaparate no seguro --> redirigimos a escaparate seguro header('Location: ' . URL_SUS_NEWS . $extra); exit; } return $isSecure; } private function paintUpperHeader(){ $arrValidEdi = explode(',', ACTIVE_SECTIONS); $edi = (isset($_GET['cp']) && $_GET['cp'] != '1' && in_array($_GET['cp'], $arrValidEdi)) ? $_GET['cp'] : ''; $queryStr = $this->cleanQueryParams(array('event', 'event_log')); $extra = (!empty($queryStr)) ? '?' . $queryStr : ''; $objCipher = new \CRMCipher(SECRET_KEY_ENC_DEC_BACKURL); if ($this->salida->resVerify){ $url = URL_SUS_NEWS . $extra; $backURL=$objCipher->encrypt($url); $this->paintFrontHeader(NULL,NULL,NULL,TRUE, urlencode($backURL), $this->salida->getUserName(), $edi); } else { $url = URL_SUS_NEWS_NOSECURE . $extra; $backURL=$objCipher->encrypt($url); $this->paintFrontHeader(NULL,NULL,NULL,FALSE, urlencode($backURL), NULL, $edi); } } } $page = new EscaparateNews(); $page->run(); ?>