<?php
declare(strict_types = 1);

class_exists('DB') || die;

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

// Permission "Accès au profil des membres".
if (!Auth::$groupPerms['members_profile'] && $_GET['user_id'] != Auth::$id)
{
	Gallery::notFound();
	return;
}

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

$r = GalleryUsers::getInfos($_GET['user_id']);
if ($r < 0)
{
	Gallery::error();
	return;
}
if ($r < 1)
{
	Gallery::notFound();
	return;
}
?>