Should be able to run on PHP >= 5.5

This commit is contained in:
simon 2017-11-25 09:44:34 -05:00
parent e3ab67e95c
commit 24f7fd670a
7 changed files with 17 additions and 33 deletions

View File

@ -18,7 +18,9 @@ if ($user != NULL) {
} else {
(new MessageCookie("Username or password incorrect", "login"))->setCookie();
$msg = new MessageCookie("Username or password incorrect", "login");
$msg->setCookie();
header("Location: login.php#login");
}

View File

@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: simon
* Date: 24/09/17
* Time: 1:59 PM
*/
class MessageCookie
{

View File

@ -1,9 +1,5 @@
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include_once "include/config.php";
class SessionManager

View File

@ -2,10 +2,6 @@
include_once "include/SqlConnection.php";
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
class TokenManager
{
/**

View File

@ -12,4 +12,3 @@ define("MAR_SERVER_NAME", "Official MAR server");
//Plugins
//Version
//Server name

View File

@ -22,6 +22,15 @@ $user = SessionManager::get();
<!--[if lte IE 8]>
<link rel="stylesheet" href="assets/css/ie8.min.css"/><![endif]-->
<style>
@font-face {
font-family: 'fixedsys';
src: url("./mar/fonts/FSEX301-L2.ttf");
}
</style>
</head>
<body class="homepage">
@ -54,16 +63,6 @@ $user = SessionManager::get();
<div class="row 200%">
<div class="12u">
<style>
@font-face {
font-family: 'fixedsys';
src: url("./mar/fonts/FSEX301-L2.ttf");
}
</style>
<!-- Features -->
<section class="box features">
<div>

View File

@ -1,9 +1,5 @@
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include_once "include/UserManager.php";
include_once "include/MessageCookie.php";
include_once "include/SessionManager.php";
@ -17,7 +13,8 @@ $password = filter_var($_POST['password'], FILTER_SANITIZE_STRING);
if (strlen($username) < 5 || strlen($username) > 20) {
(new MessageCookie("Username must be 5-20 characters", "register"))->setCookie();
$msg = new MessageCookie("Username must be 5-20 characters", "register");
$msg->setCookie();
header("Location: login.php#register");
} else if (strlen($password) < 8 || strlen($password) > 32) {
@ -32,11 +29,12 @@ if (strlen($username) < 5 || strlen($username) > 20) {
//Register success
//Generate session
SessionManager::generate(new User($username, 0));
SessionManager::generate(new User($username));
header("Location: index.php"); //todo User page
} else {
//Register failed
(new MessageCookie("Username already in use", "register"))->setCookie();
$msg = new MessageCookie("Username already in use", "register");
$msg->setCookie();
header("Location: login.php#register");
}