Added http response code

This commit is contained in:
neerholt
2021-03-19 13:25:27 +01:00
parent 409556ca2e
commit 171e0a3765
18 changed files with 103 additions and 112 deletions
+12 -11
View File
@@ -52,23 +52,24 @@ if(isLogin()){
$gameData->is_web_Based = $isWebBased;
$gameData->save();
$group->gameData()->associate($gameData);
$group->save();
header("location: ../../../Frontend/index.html?success=UploadedFile");
exit();
if(! $group->save()){
http_response_code(500);
}else{
http_response_code(201);
}
}
}else{
header("location: ../../../Frontend/group.php?error=UploadFail");
exit();
http_response_code(400);
}
}else{
header("location: ../../../Frontend/group.php?error=TooManyUploads");
exit();
echo "Can only upload one file";
http_response_code(400);
}
}else{
header("location: ../../../Frontend/group.php?error=GameJamHasNotBegun");
exit();
echo "Can only upload when the game jam has started";
http_response_code(400);
}
}else{
header("location: ../../../Main.php?error=NoLogin");
exit();
http_response_code(401);
}