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-14 20:59:42 +00:00

21 lines
444 B
PHP

<?php
$app = require '../app/inc.php';
if (!$app->user->logged_in)
{
$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");