Example #1
0
$datos->ROL_descripcion = $ROL_descripcion;
foreach ($_SESSION['usuariosSistema'] as &$var) {
    $indiceasociativo = str_replace(" ", "_", "ckbxU_" . $var . "");
    if (isset($_POST[$indiceasociativo])) {
        $datos->addUsuario($var);
    }
}
foreach ($_SESSION['funcionalidadesSistema'] as &$var) {
    $indiceasociativo = str_replace(" ", "_", "ckbxF_" . $var . "");
    if (isset($_POST[$indiceasociativo])) {
        $datos->addFuncionalidad($var);
    }
}
// ----------------------------------------- COMPROBACION DE ERRORES ---------------------------------------------------------
try {
    if ($datos->ROL_nombre != $ROL_nombreAnt && Rol::existeRol($datos->ROL_nombre)) {
        $_SESSION["error"] = 'ERR CLAVE R';
    }
} catch (Exception $e) {
    $_SESSION["error"] = $e->getMessage();
}
if (isset($_SESSION["error"])) {
    //Se agrega a las variables de sesion el objeto 'us' con los datos introducidos
    $_SESSION['claveModR'] = $ROL_nombreAnt;
    $_SESSION['recargaRolMod'] = $datos->DatosParaSesion();
    $_SESSION['recargaMR'] = 'si';
    header("Location: ModRoles.php");
    exit;
}
// ----------------------------------------------------------------------------------------------------
try {
Example #2
0
    $indiceasociativo = str_replace(" ", "_", "ckbxU_" . $var . "");
    if (isset($_POST[$indiceasociativo])) {
        $objeto->addUsuario($var);
    }
}
//Se agregan al rol las funcionalidades que va a tener en funcion de los 'checks' del formulario
foreach ($_SESSION['funcionalidadesSistema'] as &$var) {
    $indiceasociativo = str_replace(" ", "_", "ckbxF_" . $var . "");
    if (isset($_POST[$indiceasociativo])) {
        $objeto->addFuncionalidad($var);
    }
}
// ----------------------------------------- COMPROBACION DE ERRORES ---------------------------------------------------------
//Se comprueba errores en los datos
try {
    if (Rol::existeRol($objeto->ROL_nombre)) {
        $_SESSION["error"] = 'ERR CLAVE R';
    }
} catch (Exception $e) {
    $_SESSION["error"] = $e->getMessage();
}
if (isset($_SESSION["error"])) {
    //Se agrega a las variables de sesion el objeto 'us' con los datos introducidos
    $_SESSION['recargaRolAlta'] = $objeto->DatosParaSesion();
    $_SESSION['recargaAR'] = 'si';
    header("Location: AltaRoles.php");
    exit;
}
// ----------------------------------------------------------------------------------------------------
//En este punto no hubo errores
try {