From: Gonzalo Merayo Date: Tue, 4 Nov 2003 17:27:48 +0000 (+0000) Subject: Arreglo del login X-Git-Tag: svn_import~102 X-Git-Url: https://git.llucax.com/mecon/intranet.git/commitdiff_plain/2865355d3fe97e43da89dec0166f782719809ebc?ds=sidebyside Arreglo del login --- diff --git a/sistema/local_lib/HTML_Servicio.php b/sistema/local_lib/HTML_Servicio.php index 15239e8..617681b 100644 --- a/sistema/local_lib/HTML_Servicio.php +++ b/sistema/local_lib/HTML_Servicio.php @@ -59,8 +59,7 @@ class HTML_Servicio extends HTML_Table { 'border' => '0', 'cellspacing' => '0', 'cellpadding' => '0', - 'bgcolor' => '#FFFFFF', - 'class' => 'servicio_tabla')); + 'bgcolor' => '#FFFFFF')); $bd = DB::Connect('mysql://intranet:intranet@bal747f/intranet');//FIXME $this->servicio = new AI_Servicio($seccion); $this->servicio->cargar($bd); @@ -92,7 +91,7 @@ class HTML_Servicio extends HTML_Table { $int =& new HTML_Table(array('width' =>'360', 'border' => '0', 'cellspacing' => '0', - 'cellpadding' => '1', + 'cellpadding' => '0', 'bgcolor' => '#FFFFFF')); $int->addRow(array($img, '',$img,''), array()); diff --git a/sistema/www/login.php b/sistema/www/login.php index f78827c..b2c8272 100644 --- a/sistema/www/login.php +++ b/sistema/www/login.php @@ -14,36 +14,43 @@ //error connecting - return false echo "Error conectando!\n"; } - list( $uid, $domain ) = split( "@", $userid ); + @ list( $uid, $domain ) = split( "@", $userid ); + if(is_null($uid) || is_null($domain)) + $error = true; - $r = @ldap_bind($ds, "uid=$uid,ou=Personas,o=$domain,o=gov.ar", $_POST['password']); + $r = @ ldap_bind($ds, "uid=$uid,ou=Personas,o=$domain,o=gov.ar", $_POST['password']); if ($r) { - $sr = @ldap_search($ds, "ou=Personas,o=$domain,o=gov.ar", "uid=$uid"); - $info = @ldap_get_entries($ds, $sr); + $sr = @ ldap_search($ds, "ou=Personas,o=$domain,o=gov.ar", "uid=$uid"); + $info = @ ldap_get_entries($ds, $sr); } + else + $error = true; ldap_close($ds); - - if (!isset($sr)) { + if (! @ $sr) { //error reading / authenticating - return false $error = true; } else { - $_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 - + if(! @ $_POST['usuario'] || ! @ $info[0]['uidnumber'][0]) + $error = true; + else + { + $_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 + } } } + { - if(!isset($_SESSION['usuario'])) + if(!isset($_SESSION['usuario']) ) { if((isset($_GET['redirect']) && $_GET['redirect'] == 'sistemas') || (isset($_POST['redirect']) && $_POST['redirect'] == 'sistemas')) @@ -75,7 +82,7 @@ } } - if(isset($_SESSION['usuario']) && + if(isset($_SESSION['usuario']) && ! @ $error && (isset($_POST['redirect']) || isset($_GET['redirect']))) { @ $redirect = $_GET['redirect'].$_POST['redirect']; @@ -88,5 +95,6 @@ header('location: '.$redirect); else header('location: '.$link); - } + } + ?>