<?php

if(core::ifGet("id")) {
    user::deleteUser(core::getGet("id"));
    json::create("users");

    historique::recRef("/user-".core::getGet("id").".html");
    historique::add(array(
        "idType" => historique::getIdRef("ACTION"),
        "idUser" => session::getId(),
        "idPage" => historique::getIdRef("/user-".core::getGet("id").".html"),
        "log" => "Suppression du compte de " . user::getNameById(core::getGet("id"))
    ));

    alert::recSuccess("Suppression du compte de ". user::getNameById(core::getGet("id")));
}

header("Location: /parametre-users.html");
exit();