v0.1.3a fix some location error

This commit is contained in:
Victor
2021-06-08 15:07:04 +02:00
parent 5bc65aad94
commit 36640946a1
4 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
session_start();
if (!isset($_SESSION['token'])) {
header("location: ../Frontend/index.php?login=notloggedin");
header("location: ../index.php?login=notloggedin");
}
+5 -5
View File
@@ -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');
}
+1 -1
View File
@@ -2,4 +2,4 @@
session_start();
session_unset();
session_destroy();
header("location: ../../Frontend/index.php");
header("location: ../../index.php");