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