<?php
	if ( !defined('IN_MFA') )
		die("Hacking attempt");

	$user->DieNotAdmin();

$layoutadminargs['admin_start'] = $lang['admin_start'];
$layoutadminargs['general_config'] = $lang['general_config'];
$layoutadminargs['user_management'] = $lang['user_management'];
$layoutadminargs['maintenance'] = $lang['maintenance'];
$layoutadminargs['back'] = $lang['back'];

	
if(IsSet($_POST['subconfig']))
{
if($_POST['HOST_NAME'] == '')
	$escape = "Hostname ?!";

if(IsSet($escape))
	$layoutadminargs['admin_main_content'] .= "<span class='error'>".$escape."</span>";
else
{
		if(!chconfig($_POST['HOST_NAME'],$_POST['FTP_USED'],$_POST['LOG_USED'],$_POST['READ_ONLY']))
			message_die("Error","Couldn`t write Config data","Critical Error");
		else
			message_die("Job successfully done","The configuration was updated", "Message",2,"admin_config");
}
}

$layoutadminargs['info_text'] = $lang['general_config'];

$layoutadminargs['admin_main_content'] = "
<form action='index.php?mode=admin_config' method='POST'>
<table border='0'>";
	
	//HOST_NAME
	$layoutadminargs['admin_main_content'] .= "<tr><td><b>".$lang['admin_confg_hostname']."</b></td><td><input type='text' name='HOST_NAME' value='".HOST_NAME."'></td></tr>"; 	
	//ROOT_DIR
	$layoutadminargs['admin_main_content'] .= "<tr><td><b>".$lang['admin_confg_root_dir']."</b></td><td><b>".ROOT_DIR."</b></td></tr>";	
	//SCRIPT_PATH
	$layoutadminargs['admin_main_content'] .= "<tr><td><b>".$lang['admin_confg_script_path']."</b></td><td><b>".SCRIPT_PATH."</b></td></tr>";	
		//FTP_ROOT
	$layoutadminargs['admin_main_content'] .= "<tr><td><b>".$lang['admin_confg_ftp_root']."</b></td><td><b>".FTP_ROOT."</b></td></tr>";
	
	//FTP_USED
	if(FTP_USED == 1)	
		$layoutadminargs['admin_main_content'] .= "<tr><td><b>".$lang['admin_confg_ftp_used']."</b></td><td><input type='radio' name='FTP_USED' value='1' CHECKED>".$lang['yes']." &nbsp;<input type='radio' name='FTP_USED' value='0'>".$lang['no']."";
	else
		$layoutadminargs['admin_main_content'] .= "<tr><td><b>".$lang['admin_confg_ftp_used']."</b></td><td><input type='radio' name='FTP_USED' value='1'>".$lang['yes']." &nbsp;<input type='radio' name='FTP_USED' value='0' CHECKED>".$lang['no']."";
	//LOG_USED
	if(LOG_USED == 1)	
		$layoutadminargs['admin_main_content'] .= "<tr><td><b>".$lang['admin_confg_log_used']."</b></td><td><input type='radio' name='LOG_USED' value='1' CHECKED>".$lang['yes']." &nbsp;<input type='radio' name='LOG_USED' value='0'>".$lang['no']."";
	else
		$layoutadminargs['admin_main_content'] .= "<tr><td><b>".$lang['admin_confg_log_used']."</b></td><td><input type='radio' name='LOG_USED' value='1'>".$lang['yes']." &nbsp;<input type='radio' name='LOG_USED' value='0' CHECKED>".$lang['no']."";
	//READ_ONLY
	$layoutadminargs['admin_main_content'] .= "<tr><td><b>Read-only</b></td><td><input type='text' name='READ_ONLY' value='".READ_ONLY."'></td></tr>";

	
$layoutadminargs['admin_main_content'] .= "<tr><td colspan='2'><input type='submit' name='subconfig' value='Eintragen'></td></tr>
</table>
</form>";

$show_after_header .= $template->layoutparser("adminpage",$layoutadminargs);
?>