2 require_once '../local_lib/HTML_DietMarco.php';
3 require_once '../local_lib/HTML_Login.php';
5 require_once 'MECON/Usuario.php'; //Agregado MANAZAR
7 if(isset($_POST['usuario']))
9 $userid = $_POST['usuario'];
10 $ds = @ldap_connect( "ldapdist.mecon.ar" )
11 or $ds = @ldap_connect( "ldapmaster.mecon.ar" );
14 //error connecting - return false
15 echo "Error conectando!\n";
17 list( $uid, $domain ) = split( "@", $userid );
19 $r = @ldap_bind($ds, "uid=$uid,ou=Personas,o=$domain,o=gov.ar", $_POST['password']);
21 $sr = @ldap_search($ds, "ou=Personas,o=$domain,o=gov.ar", "uid=$uid");
22 $info = @ldap_get_entries($ds, $sr);
27 //error reading / authenticating - return false
28 echo "Error leyendo!\n";
32 $_SESSION['usuario'] = $_POST['usuario'];
33 $_SESSION['documento'] = $info[0]['uidnumber'][0];
36 $MECON_DNI= $info[0]['uidnumber'][0];
37 $MECON_NOMBRE= $info[0]['sn'][0]." ".$info[0]['givenname'][0];
38 $MECON_LOGIN= $_POST['usuario'];
39 $usuario=& new MECON_USUARIO();
40 $usuario->Insertar_Usuario($MECON_DNI,$MECON_LOGIN,$MECON_NOMBRE);
41 // Fin Agregado MANAZAR
45 if(!isset($_SESSION['usuario']))
47 if((isset($_GET['redirect']) && $_GET['redirect'] == 'sistemas') ||
48 (isset($_POST['redirect']) && $_POST['redirect'] == 'sistemas'))
50 $m = new HTML_DietMarco('sistemas');
51 $m->addTitle('Sistemas');
55 $m = new HTML_DietMarco('servicios');
56 $m->addTitle('Servicios');
59 $login = new HTML_Login();
60 $t = new HTML_Table(array('width' => 760,
67 $t->addRow(array($login));
69 $m->addStyleSheet($login->getCSS());
70 $m->addBodyContent($t);
75 if(isset($_SESSION['usuario']) &&
76 (isset($_POST['redirect']) || isset($_GET['redirect'])))
78 if((isset($_GET['redirect']) && $_GET['redirect'] == 'sistemas') ||
79 (isset($_POST['redirect']) && $_POST['redirect'] == 'sistemas'))
81 header('location: sistemas.php');
86 $db = DB::Connect('mysql://intranet:intranet@bal747f/intranet');
90 if(isset($_POST['redirect'])) $query .= $_POST['redirect'];
91 else $query .= $_GET['redirect'];
92 $link = $db->getOne($query);
93 header('location: '.$link);