<?php
$t = "Профиль пользователя";
if ($VarIO->DefS("module_profile_enabled", 1) == 0){
	twig("/profile.lm", ["block"	=>	"profile_disabled"]);
}
if ($user->auth() && !$acl->isProfileView){
	twig("/profile.lm", ["block"	=>	"no_access"]);
} elseif (!$user->auth() && $VarIO->DefS("module_profile_guest_view", 1) == 0){
	twig("/profile.lm", ["block"	=>	"no_access"]);
}
if ($db->Count("users","WHERE `sid` = '".$site->id."' AND `id` = '".$id."'") == 0){
	include_once 'core/head.php';
	echo '<div class="error">Пользователь не найден</div>';
	echo ($back?linkGen($back,"Вернуться назад",["data-id"=>"link-back"]):null);
	echo linkGen("/","На главную",["data-id"=>"link-home"]);
	include_once 'core/foot.php';
	exit();
}
$ank = getUserInfo($id);
if (count($ank) == 0){
	twig("/profile.lm", ["block"	=>	"404"]);
}

$t = "Просмотр профиля @".$ank["login"];
twig("/profile.lm", ["block"	=>	"base", "account"	=> $ank]);
?>