X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/89bf19b89812163353d94256d7adb0f3a9cda453..ba466154033d54821e07ab851bccc42e8e344fe9:/sistema/www/login.php diff --git a/sistema/www/login.php b/sistema/www/login.php index fb025ff..1ef3775 100644 --- a/sistema/www/login.php +++ b/sistema/www/login.php @@ -1,43 +1,72 @@ Insertar_Usuario($MECON_DNI,$MECON_LOGIN,$MECON_NOMBRE); + // Fin Agregado MANAZAR + } } - }else{ - if(!isset($_SESSION['usuario'])) + } + + { + if(!isset($_SESSION['usuario']) ) { - $m = new HTML_DietMarco('servicios'); - $m->addTitle('Servicios'); + if (preg_match('/sistemas/', @$_REQUEST['redirect']) || @$_REQUEST['embperl']) { + $m = new HTML_DietMarco('sistemas', 'Sistemas'); +// $m->addTitle('Sistemas'); + } + else + { + $m = new HTML_DietMarco('servicios', 'Servicios'); +// $m->addTitle('Servicios'); + } $login = new HTML_Login(); + if(isset($error) && $error == 1) + $login->login_incorrecto = true; $t = new HTML_Table(array('width' => 760, 'align' => 'center', 'cellspacing' => 0, @@ -53,18 +82,25 @@ } } - if(isset($_SESSION['usuario']) && (isset($_POST['redirect']) || isset($_GET['redirect']))) + if(isset($_SESSION['usuario']) && ! @ $error && + (@$_REQUEST['redirect'])) { - $db = DB::Connect('mysql://intranet:intranet@bal747f/intranet'); + $redirect = $_REQUEST['redirect']; $query = "SELECT link FROM servicio - WHERE servicio = "; - if(isset($_POST['redirect'])) - $query .= $_POST['redirect']; + WHERE servicio = $redirect"; + $link = $DB->getOne($query); + if(PEAR::isError($link)) { + + if (@$_REQUEST['embperl']) { + header('Location: /Php2Embperl_Session?redirect='.$redirect); + } + else { + header('Location: '.$redirect); + } + } else - $query .= $_GET['redirect']; - $link = $db->getOne($query); - header('location: '.$link); + header('location: '.$link); } - + ?>