Settings updated');
}
function write_settings()
{
global
$CONF_TIMEOUT_OFFLINE,
$CONF_TIMEOUT_DEAD,
$CONF_DB_HOST,
$CONF_DB_NAME,
$CONF_DB_USER,
$CONF_DB_PASS,
$CONF_PANEL_USER,
$CONF_PANEL_PASS;
file_put_contents
(
'inc/config.php',
''
);
echo_settings_updated_info();
}
if(isset($_POST['timeout_offline']))
{
action_sec_check();
if(!ctype_digit($_POST['timeout_offline']) || !ctype_digit($_POST['timeout_dead']))
echo('
Invalid timeout value
');
else
{
$CONF_TIMEOUT_OFFLINE = $_POST['timeout_offline'];
$CONF_TIMEOUT_DEAD = $_POST['timeout_dead'];
write_settings();
}
}
else if(isset($_POST['db_name']))
{
action_sec_check();
$CONF_DB_HOST = $_POST['db_host'];
$CONF_DB_NAME = $_POST['db_name'];
$CONF_DB_USER = $_POST['db_user'];
$CONF_DB_PASS = $_POST['db_pass'];
write_settings();
}
else if(isset($_POST['pass']))
{
action_sec_check();
if($_POST['pass'] === $_POST['pass2'])
{
$minChars = 4;
if(strlen($_POST['pass']) >= $minChars && strlen($_POST['user']) >= $minChars)
{
$CONF_PANEL_USER = $_POST['user'];
$CONF_PANEL_PASS = hash_pass($_POST['pass']);
write_settings();
}
else
echo('User and password must be at least '.$minChars.' characters long
');
}
else
echo('Passwords are not the same
');
}
?>