X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/2865355d3fe97e43da89dec0166f782719809ebc..HEAD:/sistema/www/login.php diff --git a/sistema/www/login.php b/sistema/www/login.php index b2c8272..1ef3775 100644 --- a/sistema/www/login.php +++ b/sistema/www/login.php @@ -1,14 +1,13 @@ Insertar_Usuario($MECON_DNI,$MECON_LOGIN,$MECON_NOMBRE); // Fin Agregado MANAZAR } @@ -52,21 +54,19 @@ { if(!isset($_SESSION['usuario']) ) { - if((isset($_GET['redirect']) && $_GET['redirect'] == 'sistemas') || - (isset($_POST['redirect']) && $_POST['redirect'] == 'sistemas')) - { + if (preg_match('/sistemas/', @$_REQUEST['redirect']) || @$_REQUEST['embperl']) { $m = new HTML_DietMarco('sistemas', 'Sistemas'); - $m->addTitle('Sistemas'); +// $m->addTitle('Sistemas'); } else { $m = new HTML_DietMarco('servicios', 'Servicios'); - $m->addTitle('Servicios'); +// $m->addTitle('Servicios'); } $login = new HTML_Login(); if(isset($error) && $error == 1) - $login->login_incorrecto = true;//FIXME terminar de prgramar cuando haya ldap + $login->login_incorrecto = true; $t = new HTML_Table(array('width' => 760, 'align' => 'center', 'cellspacing' => 0, @@ -83,16 +83,22 @@ } if(isset($_SESSION['usuario']) && ! @ $error && - (isset($_POST['redirect']) || isset($_GET['redirect']))) + (@$_REQUEST['redirect'])) { - @ $redirect = $_GET['redirect'].$_POST['redirect']; - $db = DB::Connect('mysql://intranet:intranet@bal747f/intranet'); + $redirect = $_REQUEST['redirect']; $query = "SELECT link FROM servicio WHERE servicio = $redirect"; - $link = $db->getOne($query); - if(PEAR::isError($link)) - header('location: '.$redirect); + $link = $DB->getOne($query); + if(PEAR::isError($link)) { + + if (@$_REQUEST['embperl']) { + header('Location: /Php2Embperl_Session?redirect='.$redirect); + } + else { + header('Location: '.$redirect); + } + } else header('location: '.$link); }