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);
- }
}
?>