Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/cins548. Our group project for CINS 548
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829<?php
/* * forgot.php * This script will get data posted to it from ?forgot. * It will recieve an email address, and then create a session * variable that stores the userobject for that particular email. * $_SESSION[forgotten_user']. */
require_once 'autoload.php';session_start();
// Clearing out old attemptsunset($_SESSION['forgotten_user']);
$db = new Database;
$forgotten_user = $db->get_user_from_username($_POST['email']);
if($forgotten_user != false) { $_SESSION['forgotten_user'] = $forgotten_user; header('Location: /?reset_challenge');}else { $_SESSION['error'] = 'Error retrieving account details'; header('Location: /?forgot');}