-
Notifications
You must be signed in to change notification settings - Fork 0
/
forgotPW.php
56 lines (36 loc) · 1.01 KB
/
forgotPW.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/*created by Javier Andrial*/
ini_set('display_errors', 1);
error_reporting(~0);
require 'Controller/StudentController.php';
$studentController = new StudentController();
session_start();
if(isset($_POST['textbox_newPass']) || isset($_POST['textbox_secretAns']))
{
if(isset($_POST['textbox_newPass']) && isset($_POST['textbox_secretAns']))
{
$email = $_SESSION['forgotPassword'];
$found = $studentController->resetPassword($email, $_POST['textbox_secretAns'], $_POST['textbox_newPass']);
}
else
{
$found = "You must fill both Secret Answer and New Password feilds before proceeding";
}
if (isset($_SESSION['forgotPassword']))
{
unset($_SESSION['forgotPassword']);
}
}
else if(isset($_POST['textbox_txt']))
{
$found = $studentController->findStudentAccount($_POST['textbox_txt']);
}
else
{
$found = $studentController->CreateForgotPage();
}
$title = "Forgot Password";
$content = $found;
//include 'Styles/ManageTemplate.php';
include 'template.php';
?>