From 14caad8277001a28db80f4cd6517335b160fd847 Mon Sep 17 00:00:00 2001 From: Leander Date: Thu, 27 Apr 2017 21:01:40 +0200 Subject: [PATCH] implemented login.php --- Config.txt | 4 ++++ Database.php | 2 ++ login.php | 25 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/Config.txt b/Config.txt index 574276e..f337a5e 100644 --- a/Config.txt +++ b/Config.txt @@ -30,3 +30,7 @@ = highscores.php = 15101 - User ID not specified 15102 - User ID not existing + += login.php = +16101 - User ID not specified +16102 - User ID not existing \ No newline at end of file diff --git a/Database.php b/Database.php index 1813be5..cacaeee 100644 --- a/Database.php +++ b/Database.php @@ -66,6 +66,7 @@ class Database case 13101: case 14102: case 15101: + case 16101: return 'User ID not specified. This is an internal error.'; case 12102: return 'A game without a question is not possible. Please select new game length.'; @@ -73,6 +74,7 @@ class Database return 'Sorry, we only have '.$values[0].' questions. Please try again.'; case 12104: case 15102: + case 16102: return 'The specified user name does not exist. This is an internal error.'; case 13102: return 'No valid time specified. This is an internal error.'; diff --git a/login.php b/login.php index e69de29..19fdc87 100644 --- a/login.php +++ b/login.php @@ -0,0 +1,25 @@ +query('SELECT EXISTS FROM "Users" WHERE "ID" = $1', array($uid))['data'][0]['exists']; + if ($uid_exists == 't') { + $error = 16102; + } else { + $name = $db->query('SELECT "name" FROM "Users" WHERE "ID" = $1', array($uid))['data'][0]['name']; + } +} +?> \ No newline at end of file