Commit 549cc46f authored by Stuart John Watson's avatar Stuart John Watson

Login works

parent 8cb3f2de
......@@ -29,13 +29,12 @@
function sqlite3Exists($table,$col,$val){
global $DB_CON;
$query = $DB_CON->prepare("SELECT 1 LIMIT 1 AS dupli FROM $table WHERE $col = :val");
$query = $DB_CON->prepare("SELECT 1 FROM $table WHERE $col = :val LIMIT 1");
$query->bindParam(':val', $val);
$query->execute();
$fetch = $query->fetch(SQLITE3_NUM);
return bool($fetch);
return (bool) $query->execute()->fetchArray();
}
function sqlite3Exec($query){
global $DB_CON;
return $DB_CON->exec($query);
}
......@@ -95,7 +94,6 @@
$username = strtolower();
$authResult = authCheck($authd,$username);
//If they gave a good login
if($authResult["level"] == "GAME_ACCESS"){
//Add them into the database
......
......@@ -12,5 +12,8 @@
} else {
$response = login($username,$password);
}
echo json_encode($respnose);
$response["extraPayload"] = [];
header('Content-Type: application/json');
echo json_encode($response);
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment