Exemplo n.º 1
0
function checkReadSecurity($p)
{
    $current_user = BILO_uid();
    if (BILO_isAdmin()) {
        debug("Sec passed by Group Administrador Is God(TM)", 'red');
        return True;
    }
    if ($p->inode == 0) {
        debug("Sec passed by root dir", 'red');
        return True;
    }
    // We are creating a new file or new folder
    // Check if directory has write access for all
    if (strpos($p->p_other, 'r') !== False) {
        debug("Sec passed by Other:r {$p->p_other} {$p->nombre}", 'red');
        return True;
    }
    // Check if directory has write access for group
    if (BILO_checkGroup($p->gid)) {
        if (strpos($p->p_group, 'r') !== False) {
            debug("Sec passed by Group:r", 'red');
            return True;
        }
    }
    // Check if directory has write access for user
    if (BILO_uid() == $p->uid) {
        if (strpos($p->p_owner, 'r') !== False) {
            debug("Sec passed by Owner:r " . BILO_uid() . "|" . $p->uid, 'red');
            return True;
        }
    }
    return false;
}
Exemplo n.º 2
0
function BILO_isOperator()
{
    global $SYS;
    if ($SYS["config"]["authentication"] === false) {
        debug(__FILE__ . " " . __LINE__ . ' Auth disabled by $SYS["config"]["authentication"]', "red");
        return true;
    }
    if (BILO_checkGroup("Operadores")) {
        return True;
    } else {
        return BILO_isAdmin();
    }
}
Exemplo n.º 3
0
        if (in_array($a, $acciones_permitidas)) {
            $SYS["permiso_{$a}"] = 1;
        } else {
            $SYS["permiso_{$a}"] = 0;
        }
    }
}
//-------------------------------------------------------------------------
// Si nos encontramos en 'Informes Jasper -> Informes disponibles' o en 'Informes Jasper -> Gestión' ocultamos el botón desactivar porque no se usará
if ($_SESSION["origin"] == "report" || $_SESSION["origin"] == "jasperreport") {
    $SYS["deactivate_type"] = "hidden";
} else {
    $SYS["deactivate_type"] = "image";
}
// Los botones para borrar y desactivar estarán visibles para los administradores por temas de desarrollo, mientras que para el resto de grupos únicamente el botón para desactivar
if (BILO_checkGroup("Administradores")) {
    // Mostramos el botón para borrar
    $SYS["delete_type"] = "image";
    // Definimos la ruta de los iconos
    $SYS["delete_icon_url"] = $SYS["ROOT"] . "Apps/" . $SYS["PROJECT"] . "/local/Icons/delete.png";
    $SYS["deactivate_icon_url"] = $SYS["ROOT"] . "Apps/" . $SYS["PROJECT"] . "/local/Icons/deactivate.png";
} else {
    // Ocultamos el botón para borrar
    $SYS["delete_type"] = "hidden";
    // Modificamos el icono del botón para desactivar
    $SYS["deactivate_icon_url"] = $SYS["ROOT"] . "Apps/" . $SYS["PROJECT"] . "/local/Icons/delete.png";
}
plantHTML($SYS, "interface");
if (isset($_SESSION["search"])) {
    unset($_SESSION["search"]);
    unset($_SESSION["query"]);