contenedor ( 'NAVControllerNewslettersEscaparate.tpl', DIR_PRIVATE_ELPAIS . 'NAV/templates/'.$edi.'/', DIR_RW_ELPAIS . '/pres/NAV/'.$edi.'/' ); /* $this->setHeader ( 'NAVHeaderNewsletters.tpl', DIR_PRIVATE_ELPAIS . 'NAV/templates/'.$edi.'/', DIR_RW_ELPAIS . '/pres/NAV/'.$edi.'/' ); */ $this->setFoot ( 'NAVFootNewsletters.tpl', DIR_PRIVATE_ELPAIS . 'NAV/templates/'.$edi.'/', DIR_RW_ELPAIS . '/pres/NAV/'.$edi.'/' ); $this->salida = new SUSNWEscaparateOU(); $this->setDtmDataLayer([ 'primaryCat' => 'epmas', 'subCat1' => 'epmas>newsletters', 'subCat2' => '', 'pageType' => 'otros', 'siteID' => 'elpaiscom/registro', 'cms' => 'usun' ]); parent::__construct(false,false); } public function inicio(){ $isSecure = $this->checkDomain(); if ($isSecure) $this->addCss('/css/crm-elpais-v3.css'); else $this->addCss(ELPAIS_DOMAIN.'/css/crm-elpais-v3.css'); //incluimos js //$this->addScript("/js/jquery-nightly.pack.js"); $this->addScript( "/js/omniture/perfil.js" ); $this->setBodyClass('es-newsletters escaparate'); $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.elpais.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(){ $queryStr = $this->cleanQueryParams(array('event', 'event_log')); $extra = (!empty($queryStr)) ? '?' . $queryStr : ''; if ($this->salida->resVerify){ $this->paintFrontHeader(TRUE, URL_SUS_NEWS . $extra, $this->salida->getUserNombre(),$this->salida->getEmail(),$this->salida->esSuscriptor()); } else { $this->paintFrontHeader(FALSE, URL_SUS_NEWS . $extra, NULL); } } } $page = new EscaparateNews(); $page->run(); ?>