This repository has been archived on 2023-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
web/public/login.php

22 lines
567 B
PHP
Raw Normal View History

2022-01-17 07:30:09 +01:00
<?php
2022-01-19 20:16:09 +01:00
$app = require '../app/inc.php';
2022-01-17 07:30:09 +01:00
2022-01-24 13:31:37 +01:00
if ($app->user->loggedIn)
{
2022-01-23 22:56:36 +01:00
$app->session->flash('Du er allerede pålogget');
$app->redirect('index.php');
}
if ($_SERVER['REQUEST_METHOD'] === 'POST')
{
if ($app->user->login($_POST['username'], $_POST['password']))
{
$app->session->flash("Velkommen {$_POST['username']}!");
$app->redirect('index.php');
}
$app->session->flash('Feil påloggingsinformasjon', 'danger');
}
2022-01-19 19:50:54 +01:00
$app->view('template/header', ["title" => "Logg inn"]);
2022-02-08 22:59:47 +01:00
$app->view('pages/login');
2022-01-19 19:50:54 +01:00
$app->view('template/footer');