* @package MTHPortal * @version 1.0 */ //SI NO HAY ARCHIVO DE CONFIGURACION EL SISTEMA LANZARA EL INSTALADOR if (!file_exists('database.conf.php')){ header('Location: ./instalar/index.php'); exit(); } session_start(); $timeparts = explode(' ',microtime()); $starttime = $timeparts[1].substr($timeparts[0],1); //CONSTANTES DEL SISTEMA define('XAJAX_DEFAULT_CHAR_ENCODING','ISO-8859-1'); //ARCHIVOS NECESARIOS PARA EJECUTAR EL PORTAL require_once('database.conf.php'); require_once('./clases/securesession.class.php'); require_once('./clases/mthportal.class.php'); require_once('./clases/vImage.php'); //ABRO LA SESION SEGURA $ss = new SecureSession(); $ss->check_browser = true; $ss->check_ip_blocks = 2; $ss->secure_word = 'BALATA_'; $ss->regenerate_id = true; $ss->Open(); $mth = new mth($db_conf); if(is_object($mth)){//NO HUBO ERROR AL CONECTAR A LA BASE DE DATOS //COMO TODO HA SALIDO BIEN HASTA AHORA PUES CREO EL TEMPLATE $template_dir = './templates/'.$mth->configuracion['template'].'/'; if($mth->mth_usuarios->es_admin($_SESSION['usuario']) > 0){ //EL USUARIO NO ES ADMINISTRADOR O NO ESTA CONECTADO $pagina = 'admin'; //GENERAR MENU DE ADMINISTRACION $menuweb = array(); $menuweb['Ver Web'] = $mth->configuracion['url_sistema']; //SI ES ADMINISTRADOR DE NIVEL 2 ENTONCES PUEDE CONFIGURAR APARTADOS DE LA WEB if($mth->mth_usuarios->es_admin($_SESSION['usuario']) > 1){ if ($mth->configuracion['mod_rewrite'] == 1) $menuweb['Configurar'] = $mth->configuracion['url_sistema'].'admin/configurar.html'; else $menuweb['Configurar'] = 'admin.php?sec=configurar'; } //SEPARO LAS VARIABLES DEL GET SI ES QUE HUBIERA $posicion = strrpos($_GET['sec'],'-'); if ($posicion != false) { $_GET['opt'] = substr($_GET['sec'],$posicion+1); $_GET['sec'] = substr($_GET['sec'],0,$posicion); } //GENERADOS LOS MENUS GENERO LA PAGINA QUE SE DESEA VER if($_GET['sec'] == 'configurar') include('includes/general.php'); } else header('Location: '.$mth->configuracion['url_sistema']); //PARO EL TIMER DE EJECUCION Y MUESTRO EL TEMPLATE ASI COMO EL JAVASCRIPT DE XAJAX $mth->registerFunctions('ad_ax'); $mth->xajax->setRequestURI($mth->configuracion['url_sistema'].'admin.php'); $mth->xajax->processRequests(); if ($mth->configuracion['mod_rewrite'] == 1) $XAJAX = $mth->xajax->getJavascript($mth->configuracion['url_sistema'].'js/'); else $XAJAX = $mth->xajax->getJavascript('./js/'); $timeparts = explode(" ",microtime()); $total_time = ($timeparts[1].substr($timeparts[0],1)) - $starttime; $total_time = substr($total_time,0,4); //MUESTRO EL TEMPLATE include($template_dir.'index.php'); }//FIN NO HUBO ERROR AL CONECTAR CON LA BASE DE DATOS else//HUBO ERROR AL CONECTAR CON LA BASE DE DATOS die('Error de conexión con la base de datos
Database error connection'); ?>