implemented login.php
This commit is contained in:
@@ -30,3 +30,7 @@
|
|||||||
= highscores.php =
|
= highscores.php =
|
||||||
15101 - User ID not specified
|
15101 - User ID not specified
|
||||||
15102 - User ID not existing
|
15102 - User ID not existing
|
||||||
|
|
||||||
|
= login.php =
|
||||||
|
16101 - User ID not specified
|
||||||
|
16102 - User ID not existing
|
||||||
@@ -66,6 +66,7 @@ class Database
|
|||||||
case 13101:
|
case 13101:
|
||||||
case 14102:
|
case 14102:
|
||||||
case 15101:
|
case 15101:
|
||||||
|
case 16101:
|
||||||
return 'User ID not specified. This is an internal error.';
|
return 'User ID not specified. This is an internal error.';
|
||||||
case 12102:
|
case 12102:
|
||||||
return 'A game without a question is not possible. Please select new game length.';
|
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.';
|
return 'Sorry, we only have '.$values[0].' questions. Please try again.';
|
||||||
case 12104:
|
case 12104:
|
||||||
case 15102:
|
case 15102:
|
||||||
|
case 16102:
|
||||||
return 'The specified user name does not exist. This is an internal error.';
|
return 'The specified user name does not exist. This is an internal error.';
|
||||||
case 13102:
|
case 13102:
|
||||||
return 'No valid time specified. This is an internal error.';
|
return 'No valid time specified. This is an internal error.';
|
||||||
|
|||||||
25
login.php
25
login.php
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Created by PhpStorm.
|
||||||
|
* User: leanderschmedemann
|
||||||
|
* Date: 29/03/2017
|
||||||
|
* Time: 20:54
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once('includes.inc.php');
|
||||||
|
$data = '';
|
||||||
|
$error = 0;
|
||||||
|
$uid = isset($_GET['uid']) ? $_GET['uid'] : '';
|
||||||
|
$db = new Database();
|
||||||
|
|
||||||
|
if($uid == '') {
|
||||||
|
$error = 16101;
|
||||||
|
} else {
|
||||||
|
$uid_exists = $db->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'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user