Beispiel #1
0
function VerificarUsuario()
{
    global $arrHttp, $valortag, $Path, $xWxis, $session_id, $Permiso, $msgstr, $db_path, $nombre, $Per, $adm_login, $adm_password;
    $llave = LeerRegistro();
    if ($llave != "") {
        $res = explode('|', $llave);
        $userid = $res[0];
        $_SESSION["mfn_admin"] = $res[1];
        $mfn = $res[1];
        $nombre = $res[2];
        $arrHttp["Mfn"] = $mfn;
        $Permiso = "|";
        $Per = "";
        // The first right coded in field 40 is the default right
        $value = $valortag[40];
        $fecha = $valortag[60];
        $today = date("Ymd");
        if (!empty($fecha)) {
            if ($today > $fecha) {
                header("Location: ../../index.php?login=N");
                die;
            }
        }
        $value = substr($value, 2);
        $ix = strpos($value, '^');
        $Perfil = substr($value, 0, $ix);
        $profile = file($db_path . "par/profiles/" . $Perfil);
        unset($_SESSION["profile"]);
        unset($_SESSION["permiso"]);
        $_SESSION["profile"] = $Perfil;
        foreach ($profile as $value) {
            $value = trim($value);
            if ($value != "") {
                $key = explode("=", $value);
                $_SESSION["permiso"][$key[0]] = $key[1];
            }
        }
    } else {
        if ($arrHttp["login"] == $adm_login and $arrHttp["password"] == $adm_password) {
            $Perfil = "adm";
            unset($_SESSION["profile"]);
            unset($_SESSION["permiso"]);
            $profile = file($db_path . "par/profiles/" . $Perfil);
            $_SESSION["profile"] = $Perfil;
            foreach ($profile as $value) {
                $value = trim($value);
                if ($value != "") {
                    $key = explode("=", $value);
                    $_SESSION["permiso"][$key[0]] = $key[1];
                }
            }
        } else {
            echo "<script>\r\n \t\t\tself.location.href=\"../../index.php?login=N\";\r\n \t\t\t</script>";
            die;
        }
    }
}
Beispiel #2
0
function VerificarUsuario()
{
    global $arrHttp, $valortag, $Path, $xWxis, $session_id, $Permiso, $msgstr, $db_path, $nombre, $userid, $lang;
    $llave = LeerRegistro();
    if ($llave != "") {
        $res = explode("\\|", $llave);
        $userid = $res[0];
        $_SESSION["mfn_admin"] = $res[1];
        $mfn = $res[1];
        $nombre = $res[2];
        $arrHttp["Mfn"] = $mfn;
        $Permiso = "|";
        $P = explode("\n", $valortag[40]);
        foreach ($P as $value) {
            $value = substr($value, 2);
            $ix = strpos($value, '^');
            $Permiso .= substr($value, 0, $ix) . "|";
        }
    } else {
        echo "<script>\r\n \t\tself.location.href=\"../indexmysite.php?login=N&lang=" . $lang . "\";\r\n \t\t</script>";
        die;
    }
}
Beispiel #3
0
    echo "Missing user rights";
    session_destroy();
    die;
}
foreach ($Permiso as $key => $value) {
    if (substr($key, 0, 3) == "db_") {
        $bases = substr($key, 3);
        break;
    }
}
$arrHttp["base"] = $bases;
$arrHttp["cipar"] = $arrHttp["base"] . ".par";
$NombreBase = "";
$arrHttp["Opcion"] = "STATUS";
$arrHttp["IsisScript"] = "control.xis";
$llave = LeerRegistro();
$stat = explode("\\|", $llave);
$llave = substr($stat[2], 7);
echo "<HTML><title>ABCD</title>\r\n\t\t\t\t<head>\r\n\t\t\t\t<script language=javascript src=js/lr_trim.js></script>\r\n\t\t\t\t<script languaje=javascript>\r\n\t\t\t\tself.resizeTo(screen.availWidth,screen.availHeight)\r\n\t\t\t\tself.moveTo(0,0)\r\n\t\t\t\tself.focus();\n";
if (isset($_SESSION["newindow"])) {
    // for detecting if is a new window or the same window
    echo "var neww=\"&newindow=y\"\n";
} else {
    echo "var neww=\"\"\n";
}
echo "\r\n\t\t\t\tvar listabases=Array()\r\n\t\t\t\tvar lock_db=''\r\n\t\t\t\tvar browseby=\"mfn\"\r\n\t\t\t\tvar Expresion=\"\"\r\n\t\t\t\tvar Expre_b=\"\"\r\n                var typeofrecord=''\r\n\t\t\t\tvar mfn=0\r\n\t\t\t\tvar maxmfn=0\r\n\t\t\t\tvar Mfn_Search=0\r\n\t\t\t\tvar Max_Search=0\r\n\t\t\t\tvar Search_pos=0\r\n\t\t\t\tvar db_permiso=\"{$bdright}\"\r\n\t\t\t\tvar db_copies=\"{$db_copies}\"         // to check if the database uses the copies database\r\n\t\t\t\tvar NombreBase='{$bddesc}'\r\n\t\t\t\tvar ix_basesel=0\r\n\t\t\t\tvar ix_langsel=0\r\n\t\t\t\tvar Marc=''\r\n\t\t\t\tvar base=\"{$bd}\"\r\n\t\t\t\tvar cipar=\"{$bd}.par\"\r\n\t\t\t\tvar Formato='ALL'\r\n\t\t\t\tvar tl=''\r\n\t\t\t\tvar nr=''\r\n\t\t\t\tvar xeliminar=0\r\n\t\t\t\tvar xeditar=''\r\n\t\t\t\tvar ModuloActivo=\"catalog\"\r\n\t\t\t\tvar CG_actual=''\r\n\t\t\t\tvar CG_nuevo=''\r\n\t\t\t\tvar prefijo_indice=\"\"\r\n\t\t\t\tvar formato_indice=\"\"\r\n\t\t\t\tValorCapturado=''\r\n\t\t\t\tvar NombreBaseCopiarde=''\r\n\t\t\t\tvar wks=\"\"\r\n\t\t\t\tbuscar=''\r\n\t\t\t\tlang='" . $_SESSION["lang"] . "'\r\n\t\t\t\tep=''\r\n\t\t\t\tConFormato=true\r\n\t\t\t\tCapturando=''\r\n\t\t\t\ttoolbarEnabled=''      //enable/disable the toolbar\r\n\t\t\t\tfunction AbrirVentanaAyuda(){\r\n\t\t\t\t\tinsWindow = window.open('../documentacion/ayuda.php?help='+lang+'/dataentry_toolbar.html', 'Ayuda', 'location=no,width=700,height=550,scrollbars=yes,top=10,left=100,resizable');\r\n\t\t\t\t\tinsWindow.focus()\r\n\t\t\t\t}\r\n\t\t\t";
?>

function ApagarEdicion(){
     return
}
Beispiel #4
0
<?php 
if (isset($arrHttp["see_all"])) {
    echo "<input type=hidden name=see_all value=\"S\"> ";
}
$fmt_test = "S";
$arrHttp["wks"] = "decision.fmt";
if (!isset($arrHttp["cipar"])) {
    $arrHttp["cipar"] = $arrHttp["base"] . ".par";
}
include "../dataentry/plantilladeingreso.php";
ConstruyeWorksheetFmt();
//Se lee el registro que va a ser editado
$arrHttp["lock"] = "S";
$maxmfn = $arrHttp["Mfn"];
$res = LeerRegistro($arrHttp["base"], $arrHttp["base"] . ".par", $arrHttp["Mfn"], $maxmfn, $arrHttp["Opcion"], $_SESSION["login"], "", "");
echo "<a href=../dataentry/show.php?Mfn=" . $arrHttp["Mfn"] . "&base=" . $arrHttp["base"] . " target=_blank><img src=../images/zoom.png></a> &nbsp;<strong>" . $valortag[18] . "</strong><br>";
echo "<br>";
if ($res == "LOCKREJECTED") {
    echo "<script>\r\n\talert('" . $arrHttp["Mfn"] . ": " . $msgstr["reclocked"] . "')\r\n\t</script>";
    die;
}
echo "<b>Mfn: " . $arrHttp["Mfn"] . "</b><br>";
include "../dataentry/dibujarhojaentrada.php";
PrepararFormato();
?>
 </form>
	</div>
</div>
<?php 
include "../common/footer.php";
Beispiel #5
0
        break;
    case "listar":
    case "unlock":
        $contenido = VerStatus();
        $arrHttp["IsisScript"] = "administrar.xis";
        echo "<p><span class=td>";
        MostrarPft();
        break;
    case "listadecampos":
        include "adm_listadecampos.php";
        break;
        echo "<html>\n";
        echo "<body>\n";
        echo "<script languaje=javascript>\n";
        echo "function Buscar(Clave){\n";
        echo 'Clave=Clave.substr(0,30)' . "\n";
        echo 'Clave="\\""+escape(Clave)+"\\""' . "\n";
        echo '	url="/wxis/wxis.exe?IsisScript=auditoria.xis&Opcion=buscar&Expresion="+Clave+"&Path=' . $arrHttp["Path"] . '&base=' . $arrHttp["base"] . "&cipar=" . $arrHttp["base"] . ".par\"\n";
        echo '  msgwin=window.open(url,"Window2","status=yes,resizable=yes,toolbar=no,menu=yes,scrollbars=yes,width=600,height=400,top=50,left=50")' . "\n";
        echo '  msgwin.focus()' . "\n";
        echo "}\n";
        echo "</script>\n";
        $arrHttp["IsisScript"] = "auditoria.xis";
        LeerRegistro();
        break;
}
if (!isset($arrHttp["encabezado"])) {
    if ($arrHttp["Opcion"] != "fullinv") {
        echo "<p><center><a href=index.php?base=" . $arrHttp["base"] . " class=boton> &nbsp; &nbsp; Menu &nbsp; &nbsp; </a>";
    }
}
            echo "{$value}<br>";
        }
    }
}
include "../common/header.php";
echo "\t\t<div class=\"middle form\">\r\n\t\t\t<div class=\"formContent\">\n";
$object_db = $arrHttp["base"];
echo "<h5><font color=darkred>" . $msgstr["pft_uskey"] . "</font></H5>";
$Pft = stripslashes($arrHttp["pft_uskey"]);
$Pft = urlencode($Pft);
LeerRegistro($Pft, $object_db);
echo "<h5><font color=darkred>" . $msgstr["pft_ustype"] . "</font></H5>";
$Pft = stripslashes($arrHttp["pft_ustype"]);
$Pft = urlencode($Pft);
LeerRegistro($Pft, $object_db);
echo "<h5><font color=darkred>" . $msgstr["pft_usvig"] . "</font></H5>";
$Pft = stripslashes($arrHttp["pft_usvig"]);
$Pft = urlencode($Pft);
LeerRegistro($Pft, $object_db);
echo "<h5><font color=darkred>" . $msgstr["pft_usdisp"] . "</font></H5>";
$Pft = stripslashes($arrHttp["pft_usdisp"]);
$Pft = urlencode($Pft);
LeerRegistro($Pft, $object_db);
?>
</div></div>
<?php 
include "../common/footer.php";
?>
;
</body>
</html>
Beispiel #7
0
    if (isset($valortag[$Rnr])) {
        $xnr = trim($valortag[$Rnr]);
    }
    $nuevo = "";
    if ($arrHttp["Mfn"] == "New") {
        $nuevo = "s";
    }
    $regSal = ActualizarRegistro();
    if ($nuevo == "s") {
        $arrHttp["Maxmfn"] = $arrHttp["Mfn"];
    }
    $arrHttp["Opcion"] = "ver";
    $ver = "S";
    reset($valortag);
    if (!isset($arrHttp["Formato"]) or $arrHttp["Formato"] == "") {
        $regSal = LeerRegistro($base, $cipar, $arrHttp["Mfn"], $maxmfn, $arrHttp["Opcion"], $login, $password, $arrHttp["Formato"]);
        $arrHttp["Notificacion"] = "N";
        require_once 'ingresoadministrador.php';
    } else {
        $regSal = LeerRegistroFormateado($arrHttp["Formato"]);
    }
    include "scripts_dataentry.php";
    if ($record_deleted == "N") {
        include "toolbar_record.php";
    }
    echo $regSal;
    echo "</div></div></div>";
    include "../common/footer.php";
} else {
    //se lee la fdt de la base de datos
    if ($arrHttp["Opcion"] == "crear" or $arrHttp["Opcion"] == "capturar") {
Beispiel #8
0
function ConstruyeWorksheetFMT()
{
    global $arrHttp, $vars, $db_path, $lang_db, $base_fdt, $wks_avail, $msgstr;
    $base = $arrHttp["base"];
    $fpDb_fdt = $db_path . $base . "/def/" . $_SESSION["lang"] . "/" . "{$base}.fdt";
    if (!file_exists($fpDb_fdt)) {
        $fpDb_fdt = $db_path . $base . "/def/" . $lang_db . "/" . "{$base}.fdt";
        if (!file_exists($fpDb_fdt)) {
            echo $msgstr["notfound"] . ": " . $db_path . $base . "/def/" . $_SESSION["lang"] . "/{$base}.fdt";
            die;
        }
    }
    $fpDb = file($fpDb_fdt);
    // se lee la estructura de la base de datos (dbn.fdt)
    foreach ($fpDb as $linea) {
        if (trim($linea) != "") {
            $base_fdt[] = $linea;
        }
    }
    unset($fp);
    if (isset($arrHttp["wks"])) {
        if (strpos($arrHttp["wks"], ".fmt") === false and strpos($arrHttp["wks"], ".fdt") === false) {
            $arrHttp["wks"] .= ".fmt";
        }
        $cod = $arrHttp["wks"];
        $ixpos = strpos($cod, ".");
        $cod = substr($cod, 0, $ixpos);
        if (isset($_SESSION["permiso"]["CENTRAL_ALL"]) or isset($_SESSION["permiso"][$arrHttp["base"] . "_fmt_ALL"]) or isset($_SESSION["permiso"][$arrHttp["base"] . "_fmt_{$cod}"]) or isset($_SESSION["permiso"]["ACQ_ACQALL"]) or isset($_SESSION["permiso"]["ACQ_NEWSUGGESTIONS"])) {
            if (file_exists($db_path . $base . "/def/" . $_SESSION["lang"] . "/" . $arrHttp["wks"])) {
                $fp = file($db_path . $base . "/def/" . $_SESSION["lang"] . "/" . $arrHttp["wks"]);
            } else {
                if (file_exists($db_path . $base . "/def/" . $lang_db . "/" . $arrHttp["wks"])) {
                    $fp = file($db_path . $base . "/def/" . $lang_db . "/" . $arrHttp["wks"]);
                }
            }
        } else {
            echo "\t<div class=\"middle form\">\r\n\t\t\t\t\t\t<div class=\"formContent\">\n";
            echo "<h4>" . $msgstr["fmt"] . ":" . $arrHttp["wks"] . "---- " . $msgstr["recnoallow"] . "</h4>";
            echo "<script>top.xeditar=\"\"</script>";
            $arrHttp["unlock"] = "S";
            $maxmfn = 0;
            $res = LeerRegistro($arrHttp["base"], $arrHttp["base"] . ".par", $arrHttp["Mfn"], $maxmfn, $arrHttp["Opcion"], $arrHttp["login"], $password, "");
            die;
        }
    }
    if (!isset($fp)) {
        if (isset($arrHttp["wks"])) {
            echo "<h4>" . $msgstr["notfound"] . ": " . $db_path . $base . "/def/" . $_SESSION["lang"] . "/" . $arrHttp["wks"] . "</h4>";
        }
        $vars = $base_fdt;
        return;
    }
    $ix = -1;
    reset($fp);
    foreach ($fp as $value) {
        $value = trim($value);
        if ($value != "") {
            unset($tx);
            $tx = explode('|', $value);
            if (count($tx) > 1) {
                if ($tx[0] == "LDR") {
                    $Leader = "S";
                    $Marc = "S";
                    if (file_exists($db_path . $base . "/def/" . $_SESSION["lang"] . "/leader.fdt")) {
                        $fixed = file($db_path . $base . "/def/" . $_SESSION["lang"] . "/leader.fdt");
                    } else {
                        $fixed = file($db_path . $base . "/def/" . $lang_db . "/leader.fdt");
                    }
                    foreach ($fixed as $fx) {
                        if (trim($fx) != "") {
                            $ix = $ix + 1;
                            $vars[$ix] = $fx;
                        }
                    }
                } else {
                    $ix = $ix + 1;
                    $vars[$ix] = $value;
                }
            } else {
                $primeravez = "S";
                reset($base_fdt);
                foreach ($base_fdt as $lin) {
                    unset($vx);
                    $vx = explode('|', $lin);
                    if ($vx[1] == $tx[0] or $primeravez == "N") {
                        if ($primeravez == "S") {
                            $ix = $ix + 1;
                            $vars[$ix] = $lin;
                            $primeravez = "N";
                        } else {
                            if (trim($vx[1]) != "" or $vx[0] == "H") {
                                //Si la columna de tag no tiene un blanco se termina la lista de los subcampos
                                break;
                            } else {
                                $ix = $ix + 1;
                                $vars[$ix] = $lin;
                            }
                        }
                    }
                }
            }
        }
    }
}