<?
- require_once '../local_lib/HTML_DietMarco.php';
- require_once '../local_lib/HTML_Login.php';
- require_once 'DB.php';
+ require_once 'HTML_DietMarco.php';
+ require_once 'HTML_Login.php';
require_once 'MECON/Usuario.php'; //Agregado MANAZAR
if(isset($_POST['usuario']))
{
$userid = $_POST['usuario'];
- $ds = @ldap_connect( "ldapdist.mecon.ar" )
- or $ds = @ldap_connect( "ldapmaster.mecon.ar" );
+ $ds = @ldap_connect( 'ldapdist.mecon.ar' )
+ or $ds = @ldap_connect( 'ldapmaster.mecon.ar' );
if (! $ds) {
//error connecting - return false
{
$_SESSION['usuario'] = $_POST['usuario'];
$_SESSION['documento'] = $info[0]['uidnumber'][0];
+ // Agregado por culpa de Aldoros
+ $aux = split('-',$_SESSION['documento']);
+ $_SESSION['documento'] = (count($aux) == 3) ? $aux[1] : $aux[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=& new MECON_USUARIO($DB);
$usuario->Insertar_Usuario($MECON_DNI,$MECON_LOGIN,$MECON_NOMBRE);
// Fin Agregado MANAZAR
}
{
if(!isset($_SESSION['usuario']) )
{
- if((isset($_GET['redirect']) && $_GET['redirect'] == 'sistemas') ||
- (isset($_POST['redirect']) && $_POST['redirect'] == 'sistemas'))
- {
+ if (preg_match('/sistemas/', @$_REQUEST['redirect']) || @$_REQUEST['embperl']) {
$m = new HTML_DietMarco('sistemas', 'Sistemas');
- $m->addTitle('Sistemas');
+// $m->addTitle('Sistemas');
}
else
{
$m = new HTML_DietMarco('servicios', 'Servicios');
- $m->addTitle('Servicios');
+// $m->addTitle('Servicios');
}
$login = new HTML_Login();
}
if(isset($_SESSION['usuario']) && ! @ $error &&
- (isset($_POST['redirect']) || isset($_GET['redirect'])))
+ (@$_REQUEST['redirect']))
{
- @ $redirect = $_GET['redirect'].$_POST['redirect'];
- $db = DB::Connect('mysql://intranet:intranet@bal747f/intranet');
+ $redirect = $_REQUEST['redirect'];
$query = "SELECT link
FROM servicio
WHERE servicio = $redirect";
- $link = $db->getOne($query);
- if(PEAR::isError($link))
- header('location: '.$redirect);
+ $link = $DB->getOne($query);
+ if(PEAR::isError($link)) {
+
+ if (@$_REQUEST['embperl']) {
+ header('Location: /Php2Embperl_Session?redirect='.$redirect);
+ }
+ else {
+ header('Location: '.$redirect);
+ }
+ }
else
header('location: '.$link);
}