-
Notifications
You must be signed in to change notification settings - Fork 0
/
forgot_password.php
49 lines (33 loc) · 980 Bytes
/
forgot_password.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
47
48
49
<?php
include_once '../blu/ControllerFactory.php';
$controller = ControllerFactory::getInstance()->getUserController();
$userObj = new User;
$userObj->processRequest();
// print_r($userObj);
// die();
if(FALSE == $userObj->validateEmail()){
$arr_result = array(RESULT => FAILED,
MESSAGE => "Please provide the data.",
DATA => null);
echo json_encode($arr_result);
exit;
}
$userAuthObj = $controller->selectUserEmailId($userObj->email);
// print_r($userAuthObj);
// exit;
if(NULL != $userAuthObj){
$generatePwd = $controller->generateUserToken($userObj->email);
$userObj = $controller->sendEmailForgetPassword($userObj->email);
$arr_result = array(RESULT => SUCCESS,
MESSAGE => "Email sent successfully... ",
DATA => $userObj);
echo json_encode($arr_result);
exit;
}else{
$arr_result = array(RESULT => FAILED,
MESSAGE => "Email not found",
DATA => "");
echo json_encode($arr_result);
exit;
}
?>