X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/e59d3170b36e5b9ccc19afcb1565faf4dcb40463..f776e7eb0f00bcaf3546b102fbc771b1dc58c862:/sistema/www/login.php?ds=sidebyside 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); - } } ?>