Commit
This commit is contained in:
parent
bb468aa003
commit
2f19e5eb4e
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php $app = require '../app/inc.php';
|
||||||
$app = require '../app/inc.php';
|
|
||||||
|
|
||||||
if ($app->user->loggedIn)
|
if ($app->user->loggedIn)
|
||||||
{
|
{
|
||||||
@ -7,11 +6,14 @@ if ($app->user->loggedIn)
|
|||||||
$app->redirect('index.php');
|
$app->redirect('index.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$username = (string)filter_input(INPUT_POST, 'username');
|
||||||
|
$password = (string)filter_input(INPUT_POST, 'password');
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||||
{
|
{
|
||||||
if ($app->user->login($_POST['username'], $_POST['password']))
|
if ($app->user->login($username, $password))
|
||||||
{
|
{
|
||||||
$app->session->flash("Velkommen {$_POST['username']}!");
|
$app->session->flash("Velkommen {$username}!");
|
||||||
$app->redirect('index.php');
|
$app->redirect('index.php');
|
||||||
}
|
}
|
||||||
http_response_code(401);
|
http_response_code(401);
|
||||||
|
Reference in New Issue
Block a user