View file adm_panel/settings_user.php

File size: 2.91Kb
<?
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/adm_check.php';
include_once '../sys/inc/user.php';
user_access('adm_set_user',null,'index.php?'.SID);
adm_check();

$set['title']='Пользовательские настройки';
include_once '../sys/inc/thead.php';
title();
if (isset($_POST['save']))
{

$temp_set['write_guest']=(isset($_POST['write_guest']) && $_POST['write_guest']);
$temp_set['show_away']=(isset($_POST['show_away']) && $_POST['show_away']);
$temp_set['guest_select']=(isset($_POST['guest_select']) && $_POST['guest_select']);


$temp_set['reg_select']=esc($_POST['reg_select']);
if (save_settings($temp_set))
{
admin_log('Настройки','Пользователи',"Изменение пользовательских настроек");
msg('Настройки успешно приняты');
}
else
$err='Нет прав для изменения файла настроек';
}
err();
aut();

$smarty = new Smarty_conf();
$smarty->assign('form_title','Пользовательские настройки');
$smarty->assign('method','POST');
$smarty->assign('action',"?$passgen");
$elements=array();


$options=array();
$options[]=array('close',"Закрыта",$temp_set['reg_select']=='close');
$options[]=array('open',"Открыта",$temp_set['reg_select']=='open');
$options[]=array('open_mail',"Открыта + E-mail",$temp_set['reg_select']=='open_mail');
$elements[]=array('type'=>'select', 'title' => 'Регистрация', 'br'=>1, 'info'=>array('name' => 'reg_select','options'=>$options));



$elements[]=array('type'=>'checkbox', 'br'=>1,
'info'=>array('value'=>1,'checked'=>$temp_set['guest_select'], 'name'=>'guest_select', 'text'=>'Ограниченый доступ гостям'));

$elements[]=array('type'=>'checkbox', 'br'=>1,
'info'=>array('value'=>1,'checked'=>$temp_set['show_away'], 'name'=>'show_away', 'text'=>'Отображение времени отсутствия вместо [online]'));

$elements[]=array('type'=>'checkbox', 'br'=>1,
'info'=>array('value'=>1,'checked'=>$temp_set['write_guest'], 'name'=>'write_guest', 'text'=>'Гостям можно писать в гостевой'));


$elements[]=array('type'=>'submit', 'br'=>0, 'info'=>array('name'=>'save', 'value'=>'Применить')); // кнопка
$smarty->assign('el',$elements);
$smarty->display('input.form.tpl');



$smarty = new Smarty_conf();
$smarty->assign('menu_title','Навигация');
$menu=array();
$menu[]=array('.','Админка');
$smarty->assign('menu',$menu);
$smarty->display('links.path.tpl');

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