From 8a77d0b3c6347150fe4ac26aeb17b738e91351dc Mon Sep 17 00:00:00 2001 From: Gonzalo Merayo Date: Thu, 9 Oct 2003 12:57:57 +0000 Subject: [PATCH] Login redirige cualquier cosa con redirect --- sistema/www/login.php | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/sistema/www/login.php b/sistema/www/login.php index ca3c860..f78827c 100644 --- a/sistema/www/login.php +++ b/sistema/www/login.php @@ -78,22 +78,15 @@ if(isset($_SESSION['usuario']) && (isset($_POST['redirect']) || isset($_GET['redirect']))) { - if((isset($_GET['redirect']) && $_GET['redirect'] == 'sistemas') || - (isset($_POST['redirect']) && $_POST['redirect'] == 'sistemas')) - { - header('location: sistemas.php'); - exit; - } + @ $redirect = $_GET['redirect'].$_POST['redirect']; + $db = DB::Connect('mysql://intranet:intranet@bal747f/intranet'); + $query = "SELECT link + FROM servicio + WHERE servicio = $redirect"; + $link = $db->getOne($query); + if(PEAR::isError($link)) + header('location: '.$redirect); else - { - $db = DB::Connect('mysql://intranet:intranet@bal747f/intranet'); - $query = "SELECT link - FROM servicio - WHERE servicio = "; - if(isset($_POST['redirect'])) $query .= $_POST['redirect']; - else $query .= $_GET['redirect']; - $link = $db->getOne($query); header('location: '.$link); - } } ?> -- 2.43.0