Exemple #1
0
    }
    if (!isset($_POST['password']) || empty($_POST['password'])) {
        $errors[] = 'Please enter your new password';
    }
    if (!isset($_POST['password2']) || empty($_POST['password2'])) {
        $errors[] = 'Please confirm your new password';
    }
    if (isset($_POST['password']) && isset($_POST['password2'])) {
        if ($_POST['password'] !== $_POST['password2']) {
            $errors[] = 'Passwords do not match';
        }
    }
    include_once 'pear-database-user.php';
    if (array('handle' => $_POST['handle']) != user::info($_POST['handle'], 'handle')) {
        $errors[] = 'Unknown user "' . $_POST['handle'] . '"';
        $_POST['handle'] = '';
    }
    if (!count($errors)) {
        require 'users/passwordmanage.php';
        $manager = new Users_PasswordManage();
        $errors = $manager->resetPassword($_POST['handle'], $_POST['password'], $_POST['password2']);
        if (!count($errors)) {
            $user = $_POST['handle'];
            require PEARWEB_TEMPLATEDIR . '/users/passwordreset.php';
            exit;
        }
    }
}
response_header("PEAR :: Forgot your password?");
$handle = isset($_POST['handle']) ? $_POST['handle'] : '';
require PEARWEB_TEMPLATEDIR . '/users/lostpassword.php';