diff --git a/Backend/Controllers/GameJam/NewGameJam.php b/Backend/Controllers/GameJam/NewGameJam.php index 11e09ba..f5bdfab 100644 --- a/Backend/Controllers/GameJam/NewGameJam.php +++ b/Backend/Controllers/GameJam/NewGameJam.php @@ -14,6 +14,9 @@ if(isAdmin()){ $gameJam->name = $_POST["gameJamName"]; $gameJam->start_time = $_POST["startDate"]."T".$_POST["startTime"]; $gameJam->end_time = $_POST["endDate"]."T".$_POST["endTime"]; + if (!empty($_POST['keyWord'])) { + $gameJam->key_word = $_POST['keyWord']; + } $gameJam->description = $_POST["description"]; if($gameJam->save()){ diff --git a/Backend/Controllers/Group/Group.php b/Backend/Controllers/Group/Group.php index da36077..bdf1ec6 100644 --- a/Backend/Controllers/Group/Group.php +++ b/Backend/Controllers/Group/Group.php @@ -42,4 +42,10 @@ function passwordValidate(string $password1): bool return true; } else return false; +} + +function makeLogin(string $groupName, int $groupId) +{ + setcookie("groupName", $groupName, 0, "/"); + setcookie("groupId", $groupId, 0, "/"); } \ No newline at end of file diff --git a/Backend/Controllers/Group/Login.php b/Backend/Controllers/Group/Login.php index 6bbb384..1666c9b 100644 --- a/Backend/Controllers/Group/Login.php +++ b/Backend/Controllers/Group/Login.php @@ -22,9 +22,9 @@ if(isset($_POST['login'])){ $groupPassword = Password::firstWhere('group_id', $group->id); $groupPassword->remember_token = $token; if($groupPassword->save()){ - $_SESSION['groupName'] = $groupName; $_SESSION['token'] = $token; $_SESSION['success'] = "You are now logged in"; + makeLogin($groupName,$group->id); //header('location: ../../../Frontend/index.php?login=success'); //exit(); http_response_code(200);