Rewrite alot of how game & master site are handled (note in current state its impossible to make an account.)

This commit is contained in:
SilicaAndPina 2021-05-19 00:43:27 +12:00
parent 1ad0783f8f
commit c12399dc0e
23 changed files with 548 additions and 888 deletions

View file

@ -1,3 +1,7 @@
<?php
if(session_status() !== PHP_SESSION_ACTIVE)
session_start();
?>
<HEAD>
<TITLE>HORSE ISLE - Online Multiplayer Horse Game</TITLE>
<META NAME="keywords" CONTENT="Horse Game Online MMORPG Multiplayer Horses RPG Girls Girly Isle World Island Virtual Horseisle Sim Virtual">
@ -96,10 +100,32 @@ color: #440000;
<TD WIDTH=100% BACKGROUND=/web/hoilgui4.gif align=right>
<B>
<TABLE CELLPADDING=0 CELLSPACING=2 BORDER=0><FORM METHOD=POST ACTION=/account.php>
<?php
if(isset($_SESSION["LOGGED_IN"]))
{
if($_SESSION['LOGGED_IN'] === "YES")
{
$username = "invalid";
if(isset($_SESSION['USERNAME']))
$username = $_SESSION['USERNAME'];
echo('<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10><TR><TD><B>Logged in as: '.$username.'</B><BR><BR><A HREF=/?LOGOUT=1><img src=/web/but-logout.gif border=0></A><BR><A HREF=/><img src=/web/but-mainpage.gif border=0></A></TD><TD><BR><A HREF=/account.php><img src=/web/but-serverlist.gif border=0></A><BR><A HREF=/web/news.php><img src=/web/but-news.gif border=0></A><BR><A HREF=/web/forums.php><img src=/web/but-forums.gif border=0></A><BR><A HREF=/web/helpcenter.php><img src=/web/but-helpcenter.gif border=0></A></TD></TR></TABLE>');
}
else
{
goto not_loggedin;
}
}
else
{
not_loggedin:
echo('<TABLE CELLPADDING=0 CELLSPACING=2 BORDER=0><FORM METHOD=POST ACTION=/account.php>
<TR><TD><B>USER:</B></TD><TD><INPUT TYPE=TEXT SIZE=14 NAME=USER></TD></TR>
<TR><TD><B>PASS:</B></TD><TD><INPUT TYPE=PASSWORD SIZE=14 NAME=PASS></TD></TR>
<TR><TD></TD><TD><INPUT TYPE=SUBMIT VALUE=LOGIN> (<A HREF=/web/forgotpass.php>Forgot?</A>)</TD></TR></FORM></TABLE>
<TR><TD></TD><TD><INPUT TYPE=SUBMIT VALUE=LOGIN> (<A HREF=/web/forgotpass.php>Forgot?</A>)</TD></TR></FORM></TABLE>');
}
?>
</TD>
<TD WIDTH=29><IMG SRC=/web/hoilgui5.gif></TD></TR>

View file

@ -108,6 +108,7 @@ if(isset( $_POST['user'],$_POST['pass1'],$_POST['pass2'],$_POST['sex'],$_POST['e
array_push($problems, "Email does not appear valid, you will not be able sign in without getting the login mail.");
populate_db();
$connect = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) or die("Unable to connect to '$dbhost'");
$result = mysqli_query($connect, "SELECT MAX(Id) FROM Users");
@ -120,12 +121,8 @@ if(isset( $_POST['user'],$_POST['pass1'],$_POST['pass2'],$_POST['sex'],$_POST['e
$password_hash = hash_salt($password,$salt);
$hex_salt = bin2hex($salt);
$stmt = $connect->prepare("SELECT COUNT(1) FROM Users WHERE Username=?");
$stmt->bind_param("s", $username);
$stmt->execute();
$result = $stmt->get_result();
$count = intval($result->fetch_row()[0]);
if($count !== 0)
if(user_exists($username))
array_push($problems, "Username taken. Please try a different account name.");