savepass.php 706 Bytes
<?php
require_once "include.php";

if ($user->getPasswordHash() == preg_replace('/[^0-9a-f]+/', '', $_POST['password_old'])) {
    if ((strlen(preg_replace('/[^a-f0-9]+/', '', $_POST['password_one'])) == 32) && ($session->isEnoughOld())) {
        $user->set(NULL, preg_replace('/[^a-f0-9]+/', '', $_POST['password_one']));
        $_SESSION['p'] = $user->getPasswordHash();
        $smarty->assign("pagetitle", "Change password");
        $smarty->assign("template", "savepass.tpl");
        $smarty->assign("help", help("savepass"));
        $smarty->assign("menu_button", menu_buttons());
        $smarty->display("main.tpl");
    } else {
        problem();
    }
} else {
    problem("unauth");
}

?>