|
|
@@ -121,7 +121,13 @@ $app->map(['GET', 'POST'], '/login', function (Request $request, Response $respo |
|
|
|
addFooter($response); |
|
|
|
} else { |
|
|
|
$postdata = $request->getParsedBody(); |
|
|
|
if ($postdata['username'] == 'gebruiker' && $postdata['password'] == "abcd") { |
|
|
|
|
|
|
|
global $db; |
|
|
|
$sql = "SELECT COUNT(*) as count FROM users WHERE username = '" . $postdata['username'] . "' AND password = '" . $postdata['password'] . "'"; |
|
|
|
$ret = $db->query($sql); |
|
|
|
$rows = $ret->fetchArray(SQLITE3_ASSOC); |
|
|
|
$rowcount = $rows['count']; |
|
|
|
if ($rowcount == 1) { |
|
|
|
$_SESSION["username"] = $postdata['username']; |
|
|
|
addNavbar($response); |
|
|
|
$response->getBody()->write('Logged in'); |