back end update

This commit is contained in:
2021-04-26 08:21:51 +02:00
parent a59fcdca30
commit 5213c33f2a
10 changed files with 30 additions and 12 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ if (isset($_POST['aLogin'])) {
if (password_verify($password, $hashedPassword)) {
$_SESSION['userName'] = $userName;
$_SESSION['admin'] = true;
$_SESSION['success'] = "You are now logged in";
//$_SESSION['success'] = "You are now logged in";
http_response_code(200);
makeAdminLogin($userName);
} else {
+2 -1
View File
@@ -8,7 +8,8 @@ if (isAdmin()) {
if (isset($_POST["newAdmin"])) {
$admin = new AdminUser();
$admin->user_name = $_POST["newUsername"];
$admin->password = $_POST["newPassword"];
$admin->password = password_hash($_POST["newPassword"],PASSWORD_DEFAULT);
if ($admin->save()) {
http_response_code(201);
} else {