<?php

if(core::ifGet("id")) {
    user::restoreUser(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" => "Restauration du compte de " . user::getNameById(core::getGet("id"))
    ));

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

header("Location: /user-" . core::getGet("id") . ".html");
exit();