diff --git a/Backend/Database/Group.php b/Backend/Database/Group.php index fdc744b..ee1e9a0 100644 --- a/Backend/Database/Group.php +++ b/Backend/Database/Group.php @@ -10,10 +10,10 @@ Capsule::schema()->create("groups", function (Blueprint $table){ $table->id(); $table->string("groupName"); $table->integer("groupAmount"); - $table->foreignId("fkGameJam")->constrained("game_jams"); + $table->foreignId("game_jam_id")->constrained("game_jams"); $table->integer("votes")->nullable(); - $table->foreignId("fkPassword")->constrained("password"); - $table->foreignId("fkGameData")->nullable()->constrained("game_data"); + $table->foreignId("password_id")->constrained("passwords"); + $table->foreignId("game_data_id")->nullable()->constrained("game_data"); $table->timestamps(); }); diff --git a/Backend/Database/KeyWord.php b/Backend/Database/KeyWord.php index 1135436..c71dba9 100644 --- a/Backend/Database/KeyWord.php +++ b/Backend/Database/KeyWord.php @@ -9,7 +9,7 @@ use Illuminate\Support\Facades\Schema; Capsule::schema()->create("key_words", function (Blueprint $table){ $table->id(); $table->string('keyWord'); - $table->foreignId("fkGroup")->constrained("groups"); + $table->foreignId("group_id")->constrained("groups"); $table->timestamps(); }); diff --git a/Backend/Database/Password.php b/Backend/Database/Password.php index 37f835f..f3b480f 100644 --- a/Backend/Database/Password.php +++ b/Backend/Database/Password.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; //Create password table with the rows as id, password, rememberToken and timestamps -Capsule::schema()->create("password", function (Blueprint $table){ +Capsule::schema()->create("passwords", function (Blueprint $table){ $table->id(); $table->string('password'); $table->rememberToken(); diff --git a/Backend/Login.php b/Backend/Login.php index b3d9bbc..d308aa6 100644 --- a/Backend/Login.php +++ b/Backend/Login.php @@ -1 +1,27 @@ first(); + if($group){ + $hashedPassword = $group->password()->id; + if(password_verify($password, $hashedPassword )){ + $_SESSION['groupName'] = $groupName; + $_SESSION['success'] = "You are now logged in"; + header('location: Main.php?yeah=aa'); + } + } + + +} \ No newline at end of file diff --git a/Backend/Main.php b/Backend/Main.php index cc74fcc..2b25ab5 100644 --- a/Backend/Main.php +++ b/Backend/Main.php @@ -1,6 +1,4 @@ "First game jam ever!", 'startTime' => "2021-03-03T12:40", 'endTime' => "2021-04-03T12:40", 'description' => "Det her et en beskrivelse" ]); + +?> + + + +HTML Tutorial + + +
+ + + + + +
+ + +
+ + + +
+ + + + + diff --git a/Backend/SigningUp.php b/Backend/SigningUp.php index 5b0e57f..0503989 100644 --- a/Backend/SigningUp.php +++ b/Backend/SigningUp.php @@ -1,5 +1,7 @@ password = password_hash($_POST['password'] ,PASSWORD_DEFAULT);