Esempio n. 1
0
$user = new User();
// Manage lost password
if (isset($_GET['lostpassword'])) {
    nullHeader();
    if (isset($_GET['token'])) {
        User::showPasswordForgetChangeForm($_GET['token']);
    } else {
        User::showPasswordForgetRequestForm();
    }
    nullFooter();
    exit;
}
checkLoginUser();
if (isset($_POST["update"]) && $_POST["id"] === getLoginUserID()) {
    $user->update($_POST);
    Event::log(0, "users", 5, "setup", $_SESSION["glpiname"] . "  " . $LANG['log'][21] . "  " . $_SESSION["glpiname"] . ".");
    glpi_header($_SERVER['HTTP_REFERER']);
} else {
    if ($_SESSION["glpiactiveprofile"]["interface"] == "central") {
        commonHeader($LANG['title'][13], $_SERVER['PHP_SELF'], 'preference');
    } else {
        helpHeader($LANG['title'][13], $_SERVER['PHP_SELF']);
    }
    $pref = new Preference();
    $pref->show();
    if ($_SESSION["glpiactiveprofile"]["interface"] == "central") {
        commonFooter();
    } else {
        helpFooter();
    }
}