X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/89bf19b89812163353d94256d7adb0f3a9cda453..78684ebb4c9fa80743b39ca55d2183d7d0997b27:/sistema/www/login.php?ds=sidebyside diff --git a/sistema/www/login.php b/sistema/www/login.php index fb025ff..e15ebb0 100644 --- a/sistema/www/login.php +++ b/sistema/www/login.php @@ -2,6 +2,7 @@ require_once '../local_lib/HTML_DietMarco.php'; require_once '../local_lib/HTML_Login.php'; require_once 'DB.php'; + require_once 'MECON/Usuario.php'; //Agregado MANAZAR if(isset($_POST['usuario'])) { @@ -30,12 +31,30 @@ { $_SESSION['usuario'] = $_POST['usuario']; $_SESSION['documento'] = $info[0]['uidnumber'][0]; + + // Agregado MANAZAR + $MECON_DNI= $info[0]['uidnumber'][0]; + $MECON_NOMBRE= $info[0]['sn'][0]." ".$info[0]['givenname'][0]; + $MECON_LOGIN= $_POST['usuario']; + $usuario=& new MECON_USUARIO(); + $usuario->Insertar_Usuario($MECON_DNI,$MECON_LOGIN,$MECON_NOMBRE); + // Fin Agregado MANAZAR + } }else{ if(!isset($_SESSION['usuario'])) { - $m = new HTML_DietMarco('servicios'); - $m->addTitle('Servicios'); + if((isset($_GET['redirect']) && $_GET['redirect'] == 'sistemas') || + (isset($_POST['redirect']) && $_POST['redirect'] == 'sistemas')) + { + $m = new HTML_DietMarco('sistemas'); + $m->addTitle('Sistemas'); + } + else + { + $m = new HTML_DietMarco('servicios'); + $m->addTitle('Servicios'); + } $login = new HTML_Login(); $t = new HTML_Table(array('width' => 760, @@ -53,18 +72,25 @@ } } - if(isset($_SESSION['usuario']) && (isset($_POST['redirect']) || isset($_GET['redirect']))) + if(isset($_SESSION['usuario']) && + (isset($_POST['redirect']) || isset($_GET['redirect']))) { - $db = DB::Connect('mysql://intranet:intranet@bal747f/intranet'); - $query = "SELECT link - FROM servicio - WHERE servicio = "; - if(isset($_POST['redirect'])) - $query .= $_POST['redirect']; + if((isset($_GET['redirect']) && $_GET['redirect'] == 'sistemas') || + (isset($_POST['redirect']) && $_POST['redirect'] == 'sistemas')) + { + header('location: sistemas.php'); + exit; + } else - $query .= $_GET['redirect']; - $link = $db->getOne($query); - header('location: '.$link); - } - + { + $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); + } + } ?>