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

View File

@ -1,6 +1,6 @@
<?php <?php
session_start(); session_start();
if (!isset($_SESSION['token'])) { if (!isset($_SESSION['token'])) {
header("location: ../Frontend/index.php?login=notloggedin"); header("location: ../index.php?login=notloggedin");
} }

View File

@ -18,29 +18,29 @@ if (isset($_POST['loginsubmit'])) {
if ($password->save()) { if ($password->save()) {
$_SESSION['token'] = $token; $_SESSION['token'] = $token;
$_SESSION['name'] = $username; $_SESSION['name'] = $username;
header('location: ../../Frontend/admin.php?login=success'); header('location: ../../admin.php?login=success');
exit(); exit();
http_response_code(200); http_response_code(200);
} else { } else {
session_destroy(); session_destroy();
http_response_code(500); http_response_code(500);
header('location: ../../Frontend/login.php?error=couldNotSaveToken'); header('location: ../../login.php?error=couldNotSaveToken');
} }
} else { } else {
session_destroy(); session_destroy();
http_response_code(401); http_response_code(401);
header('location: ../../Frontend/login.php?message=wrongPassword'); header('location: ../../login.php?message=wrongPassword');
//echo json_encode(["message" => "Wrong password"]); //echo json_encode(["message" => "Wrong password"]);
} }
} else { } else {
session_destroy(); session_destroy();
http_response_code(401); 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"]); //echo json_encode(["message" => "User was not found"]);
} }
} else { } else {
http_response_code(400); http_response_code(400);
header('location: ../../Frontend/login.php?message=badMethod'); header('location: ../../login.php?message=badMethod');
} }

View File

@ -2,4 +2,4 @@
session_start(); session_start();
session_unset(); session_unset();
session_destroy(); session_destroy();
header("location: ../../Frontend/index.php"); header("location: ../../index.php");

View File

@ -1,6 +1,7 @@
<?php <?php
//require "user_migration.php"; require "user_migration.php";
//require "post_migration.php"; require "post_migration.php";
echo "Nothing required/Enabled "; echo "done";
//echo "Nothing required/Enabled ";