This commit is contained in:
RundelhausCode 2021-03-16 12:46:44 +01:00
parent 8162c89051
commit 67ac104b4b
15 changed files with 56 additions and 61 deletions

View File

@ -19,17 +19,17 @@ if(isset($_POST['aLogin'])){
$_SESSION['userName'] = $userName;
$_SESSION['admin'] = true;
$_SESSION['success'] = "You are now logged in";
header('location: ../../../Frontend/index.php?login=success');
header('location: ../../../Frontend/index.html?login=success');
}else{
session_destroy();
header('location: ../../../Frontend/index.php?login=failed?reason=password');
header('location: ../../../Frontend/index.html?login=failed?reason=password');
}
}
else{
session_destroy();
header('location: ../../../Frontend/index.php?login=failed?reason=username');
header('location: ../../../Frontend/index.html?login=failed?reason=username');
}

View File

@ -15,13 +15,13 @@ function ZipFileHandler(string $gameFileName, string $gameFileTmp){
if(in_array($headerType,$headerTypeMatch)){
$gameFileNewName = uniqid("", true). "." . $fileActualExtGame;
if(empty($gameFileName)){
header("location: ../../../Frontend/index.php?error=emptyFile");
header("location: ../../../Frontend/index.html?error=emptyFile");
exit();
}
rename($gameFileTmp,"../../Games/".$gameFileNewName);
return $gameFileNewName;
}else{
header("location: location: ../../../Frontend/index.php?error=Wrong%20File%20Type");
header("location: location: ../../../Frontend/index.html?error=Wrong%20File%20Type");
}
return NULL;
}
@ -41,13 +41,13 @@ function imagesFileHandler(string $thumbnailFileName, string $thumbnailFileTmp){
if(in_array($headerType,$headerTypeMatch)){
$thumbnailFileNewName = uniqid("", true). "." . $fileActualExtThumb;
if(empty($thumbnailFileName)){
header("location: ../../../Frontend/index.php?error=emptyFile");
header("location: ../../../Frontend/index.html?error=emptyFile");
exit();
}
rename($thumbnailFileTmp,"../../../Frontend/images/".$thumbnailFileNewName);
return $thumbnailFileNewName;
}else{
header("location: location: ../../../Frontend/index.php?error=Wrong%20File%20Type");
header("location: location: ../../../Frontend/index.html?error=Wrong%20File%20Type");
}
return NULL;
}

View File

@ -2,9 +2,6 @@
require_once "../../../bootstrap.php";
use \Backend\Models\GameData;
use \Backend\Models\Group;
use \Backend\Models\GameJam;
if(isset($_GET['gameDataId'])){
$openGameDataStream = GameData::find($_GET['gameDataId']);

View File

@ -4,9 +4,7 @@ require_once('../Group/Group.php');
require_once('FileHandler.php');
use Backend\Models\GameData;
session_start();
if(isset($_SESSION['token'])){
if(isLogin()){
if(isset($_POST['submitUpdate'])){
$gameFile = $_FILES['gameFile'];
$desc = $_POST['description'];
@ -41,5 +39,5 @@ if(isset($_SESSION['token'])){
$gameData->save();
}
}else{
header("location: ../Backend/Main.php?error=NoLogin");
header("location: ../../../Frontend/index.html?error=NoLogin");
}

View File

@ -8,7 +8,6 @@ use Backend\Models\Group;
$isImages = false;
session_start();
if(isLogin()){
@ -46,8 +45,8 @@ if(isLogin()){
}
}
}else{
header("location: ../../../Frontend/group.php?error=TooManyUploads");
header("location: ../../../Frontend/index.html?error=TooManyUploads");
}
}else{
header("location: ../../../Main.php?error=NoLogin");
header("location: ../../../Frontend/index.html?error=NoLogin");
}

View File

@ -1,6 +1,6 @@
<?php
require "../../../bootstrap.php";
require_once "../../../bootstrap.php";
use Backend\Models\Group;
use Backend\Models\Password;
@ -25,7 +25,8 @@ if(isset($_POST['login'])){
$_SESSION['groupName'] = $groupName;
$_SESSION['token'] = $token;
$_SESSION['success'] = "You are now logged in";
header('location: ../../../Frontend/index.php?login=success');
//header('location: ../../../Frontend/index.php?login=success');
echo "YES";
}
else{
session_destroy();

View File

@ -1,6 +1,6 @@
<?php
require "../../../bootstrap.php";
require_once "../../../bootstrap.php";
require_once "Group.php";
use Backend\Models\Group;
@ -8,8 +8,6 @@ use Backend\Models\Password;
use Backend\Models\GameJam;
use Illuminate\Support\Str;
session_start();
$groupName = "";
$errors = array();
@ -45,8 +43,8 @@ if(isset($_POST['regGroup'])){
$_SESSION['groupName'] = $groupName;
$_SESSION['token'] = $token;
$_SESSION['success'] = "You are now logged in";
header('location: ../../../Frontend/index.php');
header('location: ../../../Frontend/index.html');
}else{
echo "asdasd";
}
}

View File

@ -1,5 +1,5 @@
<?php
require "../../../bootstrap.php";
require_once "../../../bootstrap.php";
require_once "Group.php";
use Backend\Models\Group;

View File

@ -2,7 +2,7 @@
use Backend\Models\Group;
use Backend\Models\Vote;
require "../../../bootstrap.php";
require_once "../../../bootstrap.php";
if(isset($_POST['321Vote'])){

View File

@ -1,6 +1,6 @@
<?php
use Backend\Models\Vote;
require "../../../bootstrap.php";
require_once "../../../bootstrap.php";
require_once "../Group/Group.php";
if(isLogin()){

View File

@ -1,5 +1,5 @@
<?php
require "../../../bootstrap.php";
require_once "../../../bootstrap.php";
use \Backend\Models\Group;
/**

View File

@ -1,12 +1,12 @@
<?php
require "../../../bootstrap.php";
require_once "../../../bootstrap.php";
require_once "../Group/Group.php";
use Backend\Models\Group;
use Backend\Models\KeyWord;
session_start();
if (session_status() === PHP_SESSION_ACTIVE) {
if (isLogin()) {
if(isset($_POST['submitKeyWord'])){
//Find the group id
$group = groupViaToken($_SESSION['token']);

View File

@ -1,5 +1,6 @@
<?php
use Backend\Models\GameJam;
use Illuminate\Contracts\Config;
require_once('../bootstrap.php');
@ -9,6 +10,7 @@ $gameJam = GameJam::firstOrCreate([
]);
?>
<!DOCTYPE html>

View File

@ -1,6 +1,6 @@
{
"require": {
"illuminate/database": "^8.30",
"illuminate/database": "^8.30"
},
"autoload": {
"classmap": [

60
composer.lock generated
View File

@ -103,16 +103,16 @@
},
{
"name": "illuminate/collections",
"version": "v8.31.0",
"version": "v8.32.1",
"source": {
"type": "git",
"url": "https://github.com/illuminate/collections.git",
"reference": "ecc881c6dce66e22f2c236374f342d41c7ebeb67"
"reference": "d7cc717a00064b40fa63a8ad522042005e1de1ed"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/collections/zipball/ecc881c6dce66e22f2c236374f342d41c7ebeb67",
"reference": "ecc881c6dce66e22f2c236374f342d41c7ebeb67",
"url": "https://api.github.com/repos/illuminate/collections/zipball/d7cc717a00064b40fa63a8ad522042005e1de1ed",
"reference": "d7cc717a00064b40fa63a8ad522042005e1de1ed",
"shasum": ""
},
"require": {
@ -153,11 +153,11 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-03-02T13:34:56+00:00"
"time": "2021-03-08T17:22:22+00:00"
},
{
"name": "illuminate/container",
"version": "v8.31.0",
"version": "v8.32.1",
"source": {
"type": "git",
"url": "https://github.com/illuminate/container.git",
@ -208,7 +208,7 @@
},
{
"name": "illuminate/contracts",
"version": "v8.31.0",
"version": "v8.32.1",
"source": {
"type": "git",
"url": "https://github.com/illuminate/contracts.git",
@ -256,16 +256,16 @@
},
{
"name": "illuminate/database",
"version": "v8.31.0",
"version": "v8.32.1",
"source": {
"type": "git",
"url": "https://github.com/illuminate/database.git",
"reference": "87dd6cee1eb159dfcba95bd1d2ed59d3f3244b36"
"reference": "f6a10cebd9bbd188ca66993168fb453439dbb50f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/database/zipball/87dd6cee1eb159dfcba95bd1d2ed59d3f3244b36",
"reference": "87dd6cee1eb159dfcba95bd1d2ed59d3f3244b36",
"url": "https://api.github.com/repos/illuminate/database/zipball/f6a10cebd9bbd188ca66993168fb453439dbb50f",
"reference": "f6a10cebd9bbd188ca66993168fb453439dbb50f",
"shasum": ""
},
"require": {
@ -320,11 +320,11 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-03-04T13:08:15+00:00"
"time": "2021-03-09T14:06:15+00:00"
},
{
"name": "illuminate/macroable",
"version": "v8.31.0",
"version": "v8.32.1",
"source": {
"type": "git",
"url": "https://github.com/illuminate/macroable.git",
@ -370,16 +370,16 @@
},
{
"name": "illuminate/support",
"version": "v8.31.0",
"version": "v8.32.1",
"source": {
"type": "git",
"url": "https://github.com/illuminate/support.git",
"reference": "978e64ffb68189b70fea77e4d401f43e88fa54ca"
"reference": "2ef7ff288366a1ebe32f633196a1b90bd443acc3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/support/zipball/978e64ffb68189b70fea77e4d401f43e88fa54ca",
"reference": "978e64ffb68189b70fea77e4d401f43e88fa54ca",
"url": "https://api.github.com/repos/illuminate/support/zipball/2ef7ff288366a1ebe32f633196a1b90bd443acc3",
"reference": "2ef7ff288366a1ebe32f633196a1b90bd443acc3",
"shasum": ""
},
"require": {
@ -434,7 +434,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-03-04T14:09:31+00:00"
"time": "2021-03-05T15:22:14+00:00"
},
{
"name": "nesbot/carbon",
@ -630,16 +630,16 @@
},
{
"name": "symfony/console",
"version": "v5.2.4",
"version": "v5.2.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "d6d0cc30d8c0fda4e7b213c20509b0159a8f4556"
"reference": "938ebbadae1b0a9c9d1ec313f87f9708609f1b79"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/d6d0cc30d8c0fda4e7b213c20509b0159a8f4556",
"reference": "d6d0cc30d8c0fda4e7b213c20509b0159a8f4556",
"url": "https://api.github.com/repos/symfony/console/zipball/938ebbadae1b0a9c9d1ec313f87f9708609f1b79",
"reference": "938ebbadae1b0a9c9d1ec313f87f9708609f1b79",
"shasum": ""
},
"require": {
@ -707,7 +707,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v5.2.4"
"source": "https://github.com/symfony/console/tree/v5.2.5"
},
"funding": [
{
@ -723,7 +723,7 @@
"type": "tidelift"
}
],
"time": "2021-02-23T10:08:49+00:00"
"time": "2021-03-06T13:42:15+00:00"
},
{
"name": "symfony/polyfill-ctype",
@ -1375,16 +1375,16 @@
},
{
"name": "symfony/translation",
"version": "v5.2.4",
"version": "v5.2.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "74b0353ab34ff4cca827a2cf909e325d96815e60"
"reference": "0947ab1e3aabd22a6bef393874b2555d2bb976da"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/74b0353ab34ff4cca827a2cf909e325d96815e60",
"reference": "74b0353ab34ff4cca827a2cf909e325d96815e60",
"url": "https://api.github.com/repos/symfony/translation/zipball/0947ab1e3aabd22a6bef393874b2555d2bb976da",
"reference": "0947ab1e3aabd22a6bef393874b2555d2bb976da",
"shasum": ""
},
"require": {
@ -1448,7 +1448,7 @@
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/translation/tree/v5.2.4"
"source": "https://github.com/symfony/translation/tree/v5.2.5"
},
"funding": [
{
@ -1464,7 +1464,7 @@
"type": "tidelift"
}
],
"time": "2021-03-04T15:41:09+00:00"
"time": "2021-03-06T07:59:01+00:00"
},
{
"name": "symfony/translation-contracts",