This commit is contained in:
2021-03-16 12:46:44 +01:00
parent 8162c89051
commit 67ac104b4b
15 changed files with 56 additions and 61 deletions
+3 -3
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');
}
@@ -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;
}
@@ -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']);
@@ -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");
}
+2 -3
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");
}
+3 -2
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();
+3 -5
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";
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
require "../../../bootstrap.php";
require_once "../../../bootstrap.php";
require_once "Group.php";
use Backend\Models\Group;
+1 -1
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'])){
+1 -1
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()){
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
require "../../../bootstrap.php";
require_once "../../../bootstrap.php";
use \Backend\Models\Group;
/**
+2 -2
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']);