<?php
foreach (array('start', 'compress', 'sess', 'settings', 'db_connect', 'ipua', 'fnc', 'adm_check', 'user') as $inc) {
require_once "../../sys/inc/{$inc}.php";
}
$temp_set = $set;
$set['title'] = lang('Настройки системы');
require_once H . 'sys/inc/thead.php';
aut();
if (access('adm_mysql')){
#Навигация
echo "<div class='card-header'>";
echo "<a href='/' data-toggle='tooltip' data-placement='right' title='" . lang('На главную') . "'><i class='fa fa-home fa-lg'></i></a> <i class='fa fa-angle-right fa-fw'></i> ";
echo "<a href='/panel/'>" . lang('Админ кабинет') . "</a> <i class='fa fa-angle-right fa-fw'></i> ";
echo lang('Настройки системы');
echo "</div>";
if (isset($_POST['save'])) {
$temp_set['show_err_php'] = (isset($_POST['show_err_php']) && $_POST['show_err_php']);
$temp_set['antidos'] = (isset($_POST['antidos']) && $_POST['antidos']);
$temp_set['antimat'] = (isset($_POST['antimat']) && $_POST['antimat']);
$temp_set['meta_keywords'] = esc($_POST['meta_keywords']);
$temp_set['meta_description'] = esc($_POST['meta_description']);
$temp_set['title'] = esc(stripcslashes(htmlspecialchars($_POST['title'])), 1);
$temp_set['mail_backup'] = esc($_POST['mail_backup']);
$temp_set['p_str'] = intval($_POST['p_str']);
$pdo->query("ALTER TABLE `user` CHANGE `set_p_str` `set_p_str` INT( 11 ) DEFAULT '$temp_set[p_str]'");
if (save_settings($temp_set)) {
admin_log(lang('Настройки'), lang('Система'), lang('Изменение системных настроек'));
$_SESSION['message'] = lang('Изменения сохранены');
header("Location: ?");
exit();
} else {
$err = 'Нет прав для изменения файла настроек';
}
}
echo "<form method='post' class='list-group-item' action='?'>";
$doc->Input('title', 'Название сайта', 50, "$temp_set[title]");
$doc->Input('p_str', 'Пунктов на страницу', 3, "$temp_set[p_str]");
$doc->Textarea('meta_keywords', 'Ключевые слова META', 100, "$temp_set[meta_keywords]");
$doc->Textarea('meta_description', 'Описание META', 100, "$temp_set[meta_description]");
$doc->Checkbox('antidos', 'Анти-Dos', 1, "" . ($temp_set['antidos'] ? " checked='checked'" : null) . "");
$doc->Checkbox('antimat', 'Анти-Мат', 1, "" . ($temp_set['antimat'] ? " checked='checked'" : null) . "");
$doc->Checkbox('show_err_php', 'Ошибки интерпретатора', 1, "" . ($temp_set['show_err_php'] ? " checked='checked'" : null) . "");
$doc->Input('mail_backup', 'E-mail для BackUp', 100, "$temp_set[mail_backup]");
echo "<br />";
echo "* Анти-Dos - защита от частых запросов с одного IP-адреса<br />\n";
$doc->Button('btn btn-success btn-sm', 'save', 'save', 'Сохранить');
echo "</form>\n";
}else{
header('location: /index.php');
$_SESSION['err'] = 'Ошибка доступа';
}
require_once H . 'sys/inc/tfoot.php';