2 require_once '../local_lib/HTML_DietMarco.php';
3 require_once '../local_lib/HTML_Login.php';
6 if(isset($_POST['usuario']))
8 $userid = $_POST['usuario'];
9 $ds = @ldap_connect( "ldapdist.mecon.ar" )
10 or $ds = @ldap_connect( "ldapmaster.mecon.ar" );
13 //error connecting - return false
14 echo "Error conectando!\n";
16 list( $uid, $domain ) = split( "@", $userid );
18 $r = @ldap_bind($ds, "uid=$uid,ou=Personas,o=$domain,o=gov.ar", $_POST['password']);
20 $sr = @ldap_search($ds, "ou=Personas,o=$domain,o=gov.ar", "uid=$uid");
21 $info = @ldap_get_entries($ds, $sr);
26 //error reading / authenticating - return false
27 echo "Error leyendo!\n";
31 $_SESSION['usuario'] = $_POST['usuario'];
32 $_SESSION['documento'] = $info[0]['uidnumber'][0];
35 if(!isset($_SESSION['usuario']))
37 $m = new HTML_DietMarco('servicios');
38 $m->addTitle('Servicios');
40 $login = new HTML_Login();
41 $t = new HTML_Table(array('width' => 760,
48 $t->addRow(array($login));
50 $m->addStyleSheet($login->getCSS());
51 $m->addBodyContent($t);
56 if(isset($_SESSION['usuario']) && (isset($_POST['redirect']) || isset($_GET['redirect'])))
58 $db = DB::Connect('mysql://intranet:intranet@bal747f/intranet');
62 if(isset($_POST['redirect']))
63 $query .= $_POST['redirect'];
65 $query .= $_GET['redirect'];
66 $link = $db->getOne($query);
67 header('location: '.$link);