readTemplateFromFile(MapPath()."/vistas/descargas.htm"); $objContent->setVariable('TitlePage',getMessage('MSG_SENSORALECTRONICA').' - '.getMessage('MSG_DOWNLOAD')); $objContent->setVariable('menuactivo_descarga','current'); //Seteo la opcion del menu de la izquierda FLASH seleccionada $objContent->addBlock('secciondownload'); include(MapPath().'/include/head.inc.php'); //Generacion de idiomas $strOP = getvar('op','g'); if ($strOP=='login') { //Hago el proceso de login $strUsuario = getvar('usuario','p'); $strPass = getvar('pass','p'); if ($strUsuario!='' && $strPass!='') { $strSQL = "SELECT id FROM clientes WHERE usuario='".$strUsuario."' AND pass='".$strPass."' AND publicar=1"; if (rs($strSQL,$ar)) { //Datos correctos $_SESSION['idcliente_logueado'] = $ar[0]['id']; header('location:/descargas.php'); } else { //Datos incorrectos $objContent->addBlock('login_fail'); } } else { header('location:/descargas.php'); } } else { if (getvar('idcliente_logueado','s')!='') { //El usuario esta logueado, debo traer los download que tiene acceso este cliente //Consumo el WebServices que muetsra el listado de noticias $objContent->setVariable('HTMLDownload',file_get_contents('http://'.$strURLPanelDeControl.'/admin/webservices/download.php?site='.$intIDSeccionGlobal.'&lang='.$_SESSION['langFront'].'&cliente='.getvar('idcliente_logueado','s'))); $objContent->addBlock('download'); } else { //El usario no esta logueado, por eso debo mostrar el formulario de login $objContent->addBlock('login'); } } $objContent->generateOutputToString($strContenidoSeccion); $objContent->generateOutput(); ?>