Example #1
0
    $result = $storageManager->grantAccess($_POST["login"], $_POST["mdp"]);
    if (!$result) {
        header('Location: /admin/?action=error');
    } else {
        $_SESSION["accessGranted"] = true;
    }
}
// ------------------------------------------------------------------------ //
// ---- Forms processing -------------------------------------------------- //
if (!empty($_POST)) {
    // ---- Gestion des catégories --------------------------------------- //
    if ($_POST["mon_action"] == "gerer") {
        $categorie = new Tarif_categorie();
        // ---- Traitement des données ------------------ //
        if (1 == 1) {
            $id = $categorie->gererDonnees($_POST, $debug);
        }
        // ---------------------------------------------- //
        // ---- Redirection après traitement ------------ //
        if (1 == 1) {
            $page_redirection = "/admin/tarif_categorie/liste.php";
            if ($debug) {
                echo "Redirection vers " . $page_redirection;
            } else {
                header("Location: " . $page_redirection);
            }
            exit;
        }
        // ---------------------------------------------- //
    }
    // -------------------------------------------------------------------- //