<?php
declare(strict_types = 1);

class_exists('DB') || die;

require_once(__DIR__ . '/classes/GalleryUsers.class.php');

Template::set('template',
[
	'file' => 'logout.tpl.php'
]);

$r = GalleryUsers::logout((int) ($_GET['value_1'] ?? 0));
if (is_string($r))
{
	App::redirect($r);
}
if ($r === -1)
{
	Gallery::error();
	return;
}
if ($r === 0)
{
	Gallery::notFound();
	return;
}
?>