<?php
if(core::ifGet("actif")){
    if(core::getGet("actif") == "true"){
        debug::addFile("maintenance");

        historique::recRef("/parametres.html");
        historique::add(array(
            "idType" => historique::getIdRef("ACTION"),
            "idUser" => session::getId(),
            "idPage" => historique::getIdRef("/parametres.html"),
            "log" => "Mode maintenance : Activation"
        ));

        alert::recSuccess("Le mode maintenance est activé");
    } else {
        debug::removeFile("maintenance");

        historique::recRef("/parametres.html#parametres-debug");
        historique::add(array(
            "idType" => historique::getIdRef("ACTION"),
            "idUser" => session::getId(),
            "idPage" => historique::getIdRef("/parametres.html#parametres-debug"),
            "log" => "Mode maintenance : Désactivation"
        ));

        alert::recSuccess("Le mode maintenance est désactivé");
    }
}

header("Location: /parametres.html#parametres-debug");
exit();