<?php

if (core::ifPost("from") AND core::getPost("from") == "user") {
    
    if(core::getPost("id") == "add"){
        user::add_user(core::getPost());
        header("Location: /user-" . user::lastUser() . ".html");
        exit();
        
    } else {
        user::maj_user(core::getPost());
        header("Location: /user-" . core::getPost("id") . ".html");
        exit();
    }
    
} else {
    header('HTTP/1.0 401 Unauthorized');
    exit();
}

