<?php
define('NTLCMS', 1);
$module = 'down';
include ('../system/start.php');
include ('../system/function.php');
include ('../system/antidos.php');
if (!$active){
header('Location: '.URL);
$_SESSION['fail'] = 'Вы не авторизированы!';
exit;
}
if ($set['mails'] == '1' && $_USER['admin'] != '1'){
echo '<div class="title"><center>Личная почта</center></div>';
echo '<div class="post"><center><i class="fa fa-close fa-fw"></i> Модуль закрыт администратором!</center></div>';
echo '<div class="block"><i class="fa fa-home fa-fw"></i> <a href="'.URL.'/cabinet">В кабинет</a></div>';
include ('../system/foot.php'); exit;
}
$filename = isset($_GET['filename']) ? filter_var($_GET['filename'], FILTER_SANITIZE_STRING) : false;
$row = DB :: run() -> query("select (`filename`) from `message` where `filename` = ?", array($filename)) -> fetch(PDO::FETCH_OBJ);
$s_name = FOLDER.'/mail/files/'.checkout($row -> filename);
Downloads($s_name, $row -> filename);
?>