Skip to content
Snippets Groups Projects
Commit 7e672023 authored by Stuart John Watson's avatar Stuart John Watson
Browse files

Commiting to get help with an error on line 90 of controll

parent c4bdc85b
No related branches found
No related tags found
1 merge request!1Major Rebuild: AJAX and working game info
......@@ -86,8 +86,8 @@ if ($renew){
//Check if they are still in the database
if (in_array($sessionid, $sessions)){
//If they are update the ip & time
$oldLevel = $db->query("SELECT level FROM gamers WHERE sessionid='$sessionid'");
$authd = $query->fetchArray()[0];
$query = $db->query("SELECT level FROM gamers WHERE sessionid='$sessionid'");
$oldLevel = $query->fetchArray()[0];
$query = $db->query("SELECT username FROM gamers WHERE sessionid='$sessionid'");
$authdUser = $query->fetchArray()[0];
......@@ -95,7 +95,7 @@ if ($renew){
$db->exec("DELETE FROM gamers WHERE username='$authdUser'");
$time = time();
$db->exec("INSERT INTO gamers (username,sessionid,IP,level,lastseen) VALUES ('$authdUser','$sessionid','$cip','$oldLevel','$time')");
$accessLevel = "AS_BEFORE"
$accessLevel = "AS_BEFORE";
} else {
//Otherwise return a timeout error
$accessLevel = "NO_LOGIN";
......@@ -170,7 +170,7 @@ if ($_POST["username"] == "logout"){
//If the user is logged in succesfully iterate get the online uses (into a 1d array)
$onlineUsers;
if ($accessLevel == "GAME_ACCESS"){
if ($accessLevel == "GAME_ACCESS" || ($accessLevel == "AS_BEFORE" && $oldLevel == "GAME_ACCESS")){
$onlineUsers = [];
$loggedInUsers = $db->query("SELECT username FROM gamers");
while($res =$loggedInUsers->fetchArray(SQLITE3_ASSOC)){
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment