View file xmyx.ru/adm/sys_set.php

File size: 4.86Kb
<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';

$temp_set = $set;

include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';

user_access('adm_set_sys', null, '/'.SID);

// сохранение настроек системы
function save_settings2($set)
{
    unset($set['web']);
    if(file_put_contents(H.'sys/dat/settings_6.2.dat', json_encode($set, JSON_PRETTY_PRINT), LOCK_EX))
    {
        chmod(H.'sys/dat/settings_6.2.dat', 0644);
        return true;
    }
    else
        return false;
}

if($user['level'] <= 4){  
 	header("Location: /");
	exit;
}

$set['title'] = 'Системные настройки';
include_once '../sys/inc/thead.php';


shapka_VK(true, '/adm/', 'Системные настройки');  


?>
<div class="pcont fit_box bl_cont _copts">
<?

if (isset($_POST['cfms'])){

// Показ ошибок 
if ($_POST['show_err_php'] == 1 || $_POST['show_err_php'] == 0){
	$temp_set['show_err_php'] = intval($_POST['show_err_php']);
}

//аНТИДОСС
if (isset($_POST['antidos']) && $_POST['antidos'] == 1){
	$temp_set['antidos'] = 1; 
}
else{ 
	$temp_set['antidos'] = 0;
}

// аНТИМАТ
if (isset($_POST['antimat']) && $_POST['antimat'] == 1){
	$temp_set['antimat'] = 1; 
}
else{ 
	$temp_set['antimat'] = 0;
}

// Ключевые слова (META)
$temp_set['meta_keywords'] = esc(stripcslashes(htmlspecialchars($_POST['meta_keywords'])),1);

// Описание (META)
$temp_set['meta_description'] = esc(stripcslashes(htmlspecialchars($_POST['meta_description'])),1);

$temp_set['reg_select'] = esc($_POST['reg_select']);

if (save_settings2($temp_set)){
	$_SESSION['message'] = 'Системные настройки сохранены.';    
	header("Location: /adm/sys_set.php");
	exit;
}
else
$err = 'Ошибка! У Вас нет прав для изменения!';

}


uvedom();
err();

if ($temp_set['reg_select'] == 'open')
$sel = ' selected="selected"';
else 
$sel = NULL;

?>
<div class="form_item">
<form id="levcon_block" method="post" action="?hash=<?= $passgen?>">

<dl class="fi_row">
<dt class="fi_label">
<div class="fi_header">Анти-Dos</div>
</dt>
<dd><label class="option_row" onclick="">
<input class="checkbox" name="antidos" value="1" type="checkbox"<?= ($temp_set['antidos'] ? " checked='checked'" : null)?>>
<span class="option_label">Анти-Dos - защита от частых запросов с одного IP-адреса юзера</span>
</label></dd>
</dl>

<dl class="fi_row">
<dt class="fi_label">
<div class="fi_header">Анти-Мат</div>
</dt>
<dd><label class="option_row" onclick="">
<input class="checkbox" name="antimat" value="1" type="checkbox"<?= ($temp_set['antimat'] ? " checked='checked'" : null)?>>
<span class="option_label">Анти-Мат - сделает 3 предупреждения, а затем юзеру выдаст банан!</span>
</label></dd>
</dl>

<div class="Row__label" style="padding-top: 10px;">Ошибки интерпретатора:</div>
<div class="Row__labeledContent">
<div class="Select">
<select class="Select__native" name="show_err_php">
<option class="Select__option" value="1"<?= ($temp_set['show_err_php'] == 1 ? " selected='selected'" : null)?>>Показывать админам и выше</option>
<option class="Select__option" value="0"<?= ($temp_set['show_err_php'] == 0 ? " selected='selected'" : null)?>>Скрывать вообще</option>
</select>    
<div class="Select__chevron Icon Icon_chevron_down"></div>
</div></div>

<div class="Row__label" style="padding-top: 10px;">Режим регистрации:</div>
<div class="Row__labeledContent">
<div class="Select">
<select class="Select__native" name="reg_select">
<option class="Select__option" value="close">Закрыта</option>
<option class="Select__option" value="open"<?= $sel?>>Открыта</option>
</select>    
<div class="Select__chevron Icon Icon_chevron_down"></div>
</div></div>
<?

?>
<div style="padding-top: 10px;">
<div class="Row__label">Ключевые Meta:</div>
<div class="Row__labeledContent">
<label class="Input Input_style_stretch"><input class="Input__native" name="meta_keywords" value="<?= $temp_set['meta_keywords']?>" type="text"></label>
</div>
</div>

<div style="padding-top: 10px;">
<div class="Row__label">Описание Meta:</div>
<div class="Row__labeledContent">
<label class="Input Input_style_stretch"><input class="Input__native" name="meta_description" value="<?= $temp_set['meta_description']?>" type="text"></label>
</div>
</div>


<div class="fi_row">
<input class="button" value="Сохранить" name="cfms" type="submit">  <div class="near_btn"><a href="/adm/">Назад</a></div>
</div>

</form>
</div>
</div>
<?

include_once '../sys/inc/tfoot.php';

?>