From 5d0e60cd9d91f5517e0b44fca9bf7fd904ec7d43 Mon Sep 17 00:00:00 2001 From: RundelhausCode Date: Mon, 8 Mar 2021 10:05:31 +0100 Subject: [PATCH] login update --- Backend/Login.php | 12 +++++++++++- Backend/SigningUp.php | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Backend/Login.php b/Backend/Login.php index 3064c03..f419eba 100644 --- a/Backend/Login.php +++ b/Backend/Login.php @@ -18,9 +18,19 @@ if(isset($_POST['login'])){ $hashedPassword = $group->password->password; if(password_verify($password, $hashedPassword )){ $_SESSION['groupName'] = $groupName; + $_SESSION['groupId'] = $group->id; $_SESSION['success'] = "You are now logged in"; - header('location: ../Frontend/group.php?login=success'); + header('location: ../Frontend/index.php?login=success'); + }else{ + session_destroy(); + header('location: ../Frontend/index.php?login=failed?reason=password'); } + + + } + else{ + session_destroy(); + header('location: ../Frontend/index.php?login=failed?reason=group'); } diff --git a/Backend/SigningUp.php b/Backend/SigningUp.php index 9813dee..be41a88 100644 --- a/Backend/SigningUp.php +++ b/Backend/SigningUp.php @@ -38,6 +38,7 @@ if(isset($_POST['reg_group'])){ } $_SESSION['groupName'] = $groupName; + $_SESSION['groupId'] = $group->id; $_SESSION['success'] = "You are now logged in"; header('location: index.php'); }