Added http response code
This commit is contained in:
@@ -12,19 +12,17 @@ if(isAdmin()){
|
||||
$password->password = password_hash($_POST['newPassword'], PASSWORD_DEFAULT);
|
||||
echo $password;
|
||||
if(!$password->save()){
|
||||
header("location: ../../../Frontend/Html/AdminPage.html?error=FailedSaveResetPassword");
|
||||
exit();
|
||||
http_response_code(500);
|
||||
}else{
|
||||
http_response_code(201);
|
||||
}
|
||||
}else{
|
||||
header("location: ../../../Frontend/Html/AdminPage.html?success=SavedResetPassword");
|
||||
exit();
|
||||
http_response_code(400);
|
||||
}
|
||||
|
||||
}else{
|
||||
header("location: ../../../Frontend/Html/AdminPage.html?error=FailedToResetPassword");
|
||||
exit();
|
||||
http_response_code(400);
|
||||
}
|
||||
}else{
|
||||
header("location: ../../../Frontend/index.html?error=NotAdmin");
|
||||
exit();
|
||||
http_response_code(401);
|
||||
}
|
||||
Reference in New Issue
Block a user