v0.1.3a fix some location error
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION['token'])) {
|
||||
header("location: ../Frontend/index.php?login=notloggedin");
|
||||
header("location: ../index.php?login=notloggedin");
|
||||
}
|
||||
|
||||
|
||||
@@ -18,29 +18,29 @@ if (isset($_POST['loginsubmit'])) {
|
||||
if ($password->save()) {
|
||||
$_SESSION['token'] = $token;
|
||||
$_SESSION['name'] = $username;
|
||||
header('location: ../../Frontend/admin.php?login=success');
|
||||
header('location: ../../admin.php?login=success');
|
||||
exit();
|
||||
http_response_code(200);
|
||||
} else {
|
||||
session_destroy();
|
||||
http_response_code(500);
|
||||
header('location: ../../Frontend/login.php?error=couldNotSaveToken');
|
||||
header('location: ../../login.php?error=couldNotSaveToken');
|
||||
}
|
||||
|
||||
} else {
|
||||
session_destroy();
|
||||
http_response_code(401);
|
||||
header('location: ../../Frontend/login.php?message=wrongPassword');
|
||||
header('location: ../../login.php?message=wrongPassword');
|
||||
//echo json_encode(["message" => "Wrong password"]);
|
||||
}
|
||||
|
||||
} else {
|
||||
session_destroy();
|
||||
http_response_code(401);
|
||||
header('location: ../../Frontend/login.php?message=userWasNotFound');
|
||||
header('location: ../../login.php?message=userWasNotFound');
|
||||
//echo json_encode(["message" => "User was not found"]);
|
||||
}
|
||||
} else {
|
||||
http_response_code(400);
|
||||
header('location: ../../Frontend/login.php?message=badMethod');
|
||||
header('location: ../../login.php?message=badMethod');
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
session_start();
|
||||
session_unset();
|
||||
session_destroy();
|
||||
header("location: ../../Frontend/index.php");
|
||||
header("location: ../../index.php");
|
||||
|
||||
Reference in New Issue
Block a user