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/logout.php
2022-04-13 19:22:21 +00:00

21 lines
443 B
PHP

<?php
$app = require '../app/inc.php';
if (!$app->user->loggedIn)
{
$app->redirect('login.php');
}
$confirm = filter_input(INPUT_GET, 'confirm', FILTER_VALIDATE_BOOLEAN);
if (!$confirm)
{
$app->view('template/header', ["title" => "Bekreft avlogging"]);
$app->view('pages/logout');
$app->view('template/footer');
die();
}
$app->user->logout();
$app->session->flash('Du har blitt logget av');
$app->redirect("login.php");