code restructured
This commit is contained in:
19
login.php
19
login.php
@@ -9,17 +9,30 @@
|
||||
require_once('includes.inc.php');
|
||||
$data = '';
|
||||
$error = 0;
|
||||
$uid = isset($_GET['uid']) ? $_GET['uid'] : '';
|
||||
$uid = isset($_GET['uid']) ?
|
||||
$_GET['uid'] : '';
|
||||
$db = new Database();
|
||||
|
||||
if($uid == '') {
|
||||
$error = 16101;
|
||||
} else {
|
||||
$uid_exists = $db->query('SELECT EXISTS (SELECT 1 FROM "Users" WHERE "ID" = $1)', array($uid))['data'][0]['exists'];
|
||||
$uid_exists = $db->query(
|
||||
'SELECT EXISTS (
|
||||
SELECT 1
|
||||
FROM "Users"
|
||||
WHERE "ID" = $1
|
||||
)',
|
||||
array($uid)
|
||||
)['data'][0]['exists'];
|
||||
if ($uid_exists == 'f') {
|
||||
$error = 16102;
|
||||
} else {
|
||||
$name = $db->query('SELECT "name" FROM "Users" WHERE "ID" = $1', array($uid))['data'][0]['name'];
|
||||
$name = $db->query(
|
||||
'SELECT "name"
|
||||
FROM "Users"
|
||||
WHERE "ID" = $1',
|
||||
array($uid)
|
||||
)['data'][0]['name'];
|
||||
$data = array('uid' => $uid, 'name' => $name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user