Login Functionality Update

This commit is contained in:
Minik Gaarde Lambrecht
2021-03-22 15:29:18 +01:00
parent b524cd45fe
commit 029bc3c67d
11 changed files with 50 additions and 56 deletions
@@ -17,4 +17,4 @@ if(isset($_GET['gameDataId'])){
header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
header('Content-Type: application/json;charset=UTF-8');
echo $openGameDataStream->toJson(JSON_PRETTY_PRINT);
echo json_encode(array('data' => $openGameDataStream->jsonSerialize()));
+2 -1
View File
@@ -12,6 +12,7 @@ if(isset($_GET['gameJamId'])){
header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
header('Content-Type: application/json;charset=UTF-8');
echo $dbValue->toJson(JSON_PRETTY_PRINT);
echo json_encode(array('data' => $dbValue->jsonSerialize()));
//var_dump(headers_list());
+1 -1
View File
@@ -15,4 +15,4 @@ else{
header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
header('Content-Type: application/json;charset=UTF-8');
echo $groups->toJson(JSON_PRETTY_PRINT);
echo json_encode(array('data' => $groups->jsonSerialize()));
+1 -1
View File
@@ -5,7 +5,7 @@ require_once "../Group/Group.php";
if(isLogin()){
header('Content-Type: application/json;charset=UTF-8');
echo Vote::where('group_id',groupViaToken($_SESSION['token'])->id)->get()->toJson(JSON_PRETTY_PRINT);
echo json_encode(array('data' => Vote::where('group_id',groupViaToken($_SESSION['token'])->id)->get()->jsonSerialize()));
}else{
echo http_response_code(401);
+1 -1
View File
@@ -25,7 +25,7 @@ if(isAdmin() && isset($_GET['gameJamId'])){
header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
header('Content-Type: application/json;charset=UTF-8');
echo $winningGroups->toJson(JSON_PRETTY_PRINT);
echo json_encode(array('data' => $winningGroups->jsonSerialize()));
}else{
+1 -1
View File
@@ -23,7 +23,7 @@ if (!isAdmin()){
header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
header('Content-Type: application/json;charset=UTF-8');
echo $find_all_keywords->pluck("key_word")->toJson(JSON_PRETTY_PRINT);
echo json_encode(array('data' => $find_all_keywords->jsonSerialize()));
}else{
echo http_response_code(400);
}