<?
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';
only_level(4);

if (!isset($access['settings_change'])){header("Location: index.php?".SID);exit;}
$set['title']='Настройки регистрации';
include_once '../sys/inc/thead.php';
title();
if (isset($_POST['save']))
{
$temp_set['reg_select']=esc($_POST['reg_select']);
if (save_settings($temp_set))
msg('Настройки успешно приняты');
else
$err='Нет прав для изменения файла настроек';
}
err();
aut();



echo "<form method=\"post\" action=\"?\">\n";

echo "Режим регистрации:<br />\n<select name=\"reg_select\">\n";
echo "<option value=\"close\">Закрыта</option>\n";
if ($temp_set['reg_select']=='open')$sel=' selected="selected"';else $sel=NULL;
echo "<option value=\"open\"$sel>Открыта</option>\n";
if ($temp_set['reg_select']=='open_mail')$sel=' selected="selected"';else $sel=NULL;
echo "<option value=\"open_mail\"$sel>Открыта + E-mail</option>\n";
echo "</select><br />\n";



echo "<input value=\"Изменить\" name='save' type=\"submit\" />\n";
echo "</form>\n";


echo "<div class='foot'>\n";
echo "&laquo;<a href='/adm_panel/'>В админку</a><br />\n";
echo "</div>\n";

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