<?PHP
include"../inc/var.php";
include "../inc/connect.php";
include $server_inc."/client_functions.php";
include $server_inc."/login_functions.php";
include $server_inc."/whm_functions.php";
include $server_inc."/enom_functions.php";
include $server_admin_inc."/header.php";

$input0="Enter the default site title here.";
$input1="Enter the default name of your site here.";
$input2="Enter the system notification email.";
$input3="Enter the IP address of a remote DNS server here.";

if(phpversion() <= "4.0.6") { $_POST=$HTTP_POST_VARS; }
if ($_POST['submit'])
	{
	if (trim($_POST['site_title'])==$input0||trim($_POST['site_title'])=="") { $e0=true; }
	if (trim($_POST['site_name'])==$input1||trim($_POST['site_name'])=="") { $e1=true; }
	if (trim($_POST['balance_required_for_payment'])=="") { $e3=true; }
	if (trim($_POST['currency'])=="") { $e4=true; }
	if (trim($_POST['currency_type'])=="") { $e5=true; }
	# if (trim($_POST['domain_fee'])=="") { $e6=true; }
	# if (trim($_POST['resolve_server'])==$input3||trim($_POST['resolve_server'])=="") { $e7=true; }
	# if (trim($_POST['run_domain_expire'])=="") { $e8=true; }
	/*
	if (trim($_POST['email_admin'])==$input2||trim($_POST['email_admin'])=="") { $e2=true; }
	if (trim($_POST['username'])=="") { $e9=true; }
	if (trim($_POST['password'])==""||strcmp($_POST['password'], $_POST['password1'])!=0) { $e10=true; }
	*/
	if (trim($_POST['http_web'])=="") { $e11=true; }
	if (trim($_POST['server_root'])=="") { $e12=true; }
	if (trim($_POST['below_public'])=="") { $e13=true; }
	
	if (!isset($e0)&&!isset($e1)/*&&!isset($e2)*/&&!isset($e3)&&!isset($e4)
		&&!isset($e5)&&!isset($e6)/*&&!isset($e7)&&!isset($e8)&&!isset($e9)
		&&!isset($e10)*/&&!isset($e11)&&!isset($e12)&&!isset($e13))
		{
		$query="update ";
		$query.="config ";
		$query.="set ";
		$query.="email_support='".addslashes(trim($_POST['email_admin']))."', ";
		$query.="get_mib_news='tno://benchmarkdesigns.net/mib_news.nfo', ";
		$query.="copyright='<FONT COLOR=\"#ffffff\" SIZE=\"-2\" FACE=\"Verdana\">© 2002 Benchmark Designs, LLC.</FONT>', ";
		$query.="button_style='style=\"font-family:verdana, arial, helvetica; font-size: 8pt; border-style: solid; border-color: 000000; border-width: 1pxl; background-color: dbedf9; font-weight: 800\"', ";
		$query.="input_style='style=\"font-family:verdana, arial, helvetica; font-size: 8pt; border-style: solid; border-color: 000000; border-width: 1pxl; background-color: ffffff\"', ";
		$query.="phpbb_active='no', ";
		$query.="strong_security='no', ";
		$query.="theme='blue', ";
		$query.="site_title='".addslashes(trim($_POST['site_title']))."', ";
		$query.="site_name='".addslashes(trim($_POST['site_name']))."', ";
		$query.="balance_required_for_payment='".addslashes(trim(str_replace("$", "", $_POST['balance_required_for_payment'])))."', ";
		$query.="currency='".addslashes(trim($_POST['currency']))."', ";
		$query.="currency_type='".addslashes(trim($_POST['currency_type']))."', ";
		$query.="domain_fee='".addslashes(trim($_POST['domain_fee']))."', ";
		if (isset($_POST['resolve_server']))
			{
			$query.="resolve_server='".addslashes(trim($_POST['resolve_server']))."', ";
			}
		# $query.="run_domain_expire='".addslashes(trim($_POST['run_domain_expire']))."', ";
		$query.="http_web='".addslashes(trim($_POST['http_web']))."', ";
		$query.="server_root='".addslashes(trim($_POST['server_root']))."', ";
		$query.="below_public='".addslashes(trim($_POST['below_public']))."', ";
		$query.="default_reseller_cpanel_theme='".addslashes(trim(strtolower($_POST['default_reseller_cpanel_theme'])))."', ";
		$query.="http_web_tools='".addslashes(trim($_POST['http_web']."/tools"))."', ";
		$query.="http_admin='".addslashes(trim($_POST['http_web']."/admin"))."', ";
		$query.="http_admin_tools='".addslashes(trim($_POST['http_web']."/admin/tools"))."', ";
		$query.="http_images='".addslashes(trim($_POST['http_web']."/admin/themes/blue/images"))."', ";
		$query.="server_backup='".addslashes(trim($_POST['below_public']."/dbbackup"))."', ";
		$query.="resolver_log='".addslashes(trim($_POST['below_public']."/resolver_logs"))."', ";
		$query.="server_tools='".addslashes(trim($_POST['server_root']."/tools"))."', ";
		$query.="server_admin_inc='".addslashes(trim($_POST['server_root']."/admin/themes/blue"))."', ";
		$query.="server_inc='".addslashes(trim($_POST['server_root']."/inc"))."', ";
		$query.="server_admin='".addslashes(trim($_POST['server_root']."/admin"))."', ";
		$query.="server_admin_tools='".addslashes(trim($_POST['server_root']."/admin/tools"))."', ";
		$query.="invoice_notice_period='".addslashes(trim($_POST['invoice_notice_period']))."', ";
		$query.="email_support='".addslashes(trim($_POST['email_support']))."', ";
		$query.="license='".addslashes(trim($_POST['license']))."', ";
		$query.="tos_agreement='".addslashes(trim($_POST['tos_agreement']))."', ";
		$query.="session_expire='".addslashes(trim($_POST['session_expire']))."', ";
		$query.="local_lang='".addslashes(trim($_POST['local_lang']))."', ";
		$query.="send_reminders='".addslashes(trim($_POST['send_reminders']))."', ";
		if (isset($_POST['cont_resolve']))
			{
			$query.="cont_resolve='".addslashes(trim($_POST['cont_resolve']))."', ";
			}
		$query.="resolve_works='".addslashes(trim($_POST['resolve_works']))."'";
		
		mysql_query($query);
		/*
		$query1="delete ";
		$query1.="from ";
		$query1.="user ";
		$query1.="where ";
		$query1.="status='69'";
		mysql_query($query1);

		$query0="insert ";
		$query0.="into ";
		$query0.="user ";
		$query0.="set ";
		$query0.="email='".addslashes(trim($_POST['email_admin']))."', ";
		$query0.="username='".addslashes(trim($_POST['username']))."', ";
		$query0.="password='".md5(strtolower(trim($_POST['password'])))."', ";
		$query0.="sid='".md5(microtime())."', ";
		$query0.="status='69'";
		mysql_query($query0);
		*/
		
		$done=true;
		}

	if ($_POST['use_enom']==1) 
		{ 
		if (trim($_POST['enom_user'])=="") { $enom0=true; }
		if (trim($_POST['enom_pass'])=="") { $enom1=true; }
		if (trim($_POST['enom_ip'])=="") { $enom2=true; }

		if (!isset($enom0)&&!isset($enom1)&&!isset($enom2)) 
			{ 
			$query="update ";
			$query.="config ";
			$query.="set ";
			$query.="enom_ip='".addslashes(trim($_POST['enom_ip']))."'";
			
			mysql_query($query);

			enom_record_logins($_POST['enom_user'], $_POST['enom_pass']); 
			}
		}
	else
		{
		$query="update ";
		$query.="config ";
		$query.="set ";
		$query.="enom_ip='', ";
		$query.="enom_user='', ";
		$query.="enom_pass='', ";
		$query.="use_enom='0'";
		
		mysql_query($query);
		}
	}

echo("
	<table width='725' cellpadding='0' cellspacing='0' border='0'>
		<tr>
			<td width='1%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='375'></td>
			<td width='99%' align='left' valign='top'>
			
	");
if (isset($done))
	{
	echo("
			<table width='100%' cellpadding='4' cellspacing='0' border='0'>
				<tr>
					<td><img src='".$http_images."/menu_arrow.gif'>&nbsp;<b>WHM AutoPilot Configuration Editor</b></td>
				</tr>
				<tr>
					<td><hr color='#F7F3F7'></td>
				</tr>
				<tr>
					<td>&nbsp;<img src='".$http_images."/error_arrow.gif'><a href='".$http_admin."/config_editor.php?sid=".$sid."'>Continue with edits</a></td>
				</tr>
				<tr>
					<td>&nbsp;<img src='".$http_images."/error_arrow.gif'><a href='".$http_admin."/index2.php?sid=".$sid."'>I'm finished with edits</a></td>
				</tr>
			</table>
			</td>
		</tr>
	</table>
	");

	include $server_admin_inc."/footer.php";
	mysql_close($dblink);
	die();
	}

$query="select ";
$query.="resolve_works, ";
$query.="cont_resolve, ";
$query.="enom_ip, ";
$query.="send_reminders ";
$query.="from ";
$query.="config ";
$query.="limit 0, 1";

$rs=mysql_fetch_row(mysql_query($query));

$resolve_works=stripslashes(trim($rs[0]));
$cont_resolve=stripslashes(trim($rs[1]));
$enom_ip=stripslashes(trim($rs[2]));
$send_reminders=stripslashes(trim($rs[3]));

if ($use_enom==1) 
	{ 
	$temp=enom_get_logins();
	list($enom_user, $enom_pass)=explode("|", $temp);
	}

echo("
			<form action='".$PHP_SELF."' method='POST'>
			<input type='hidden' name='no' value='5'>
			<input type='hidden' name='sid' value='".$sid."'>
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td colspan='2'><img src='".$http_images."/menu_arrow.gif'>&nbsp;<b>WHM AutoPilot Configuration Editor</b></td>
				</tr>
				<tr>
					<td colspan='2'><hr color='#F7F3F7'></td>
				</tr>
	");
if (isset($enom0))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>You must enter an enom username to continue.</font></td>
				</tr>
		");
	}
if (isset($enom1))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>You must enter an enom password to continue.</font></td>
				</tr>
		");
	}
if (isset($enom2))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>You must enter the IP address that your registered at Enom to continue.</font></td>
				</tr>
		");
	}
if (isset($e0))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>You must enter a Site Title to continue.</font></td>
				</tr>
		");
	}
if (isset($e1))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>You must enter a Site Name to continue.</font></td>
				</tr>
		");
	}
if (isset($e2))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>You must enter an System Email Address to continue.</font></td>
				</tr>
		");
	}
if (isset($e3))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>You must enter a Minimum Affiliate Payout to continue.</font></td>
				</tr>
		");
	}
if (isset($e4))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>Please enter the default Currency to continue.</font></td>
				</tr>
		");
	}
if (isset($e5))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>Please enter the default Currency Type to continue.</font></td>
				</tr>
		");
	}
if (isset($e6))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>You must enter a Domain Name Fee to continue.</font></td>
				</tr>
		");
	}
if (isset($e7))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>You must enter a Resolve Server to continue.</font></td>
				</tr>
		");
	}
if (isset($e8))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>Please enter yes or no for Enable Domain Expire Check.</font></td>
				</tr>
		");
	}
if (isset($e9))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>You must enter a username to continue.</font></td>
				</tr>
		");
	}
if (isset($e10))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>Please re-enter your passwords to continue.</font></td>
				</tr>
		");
	}
if (isset($e11))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>You must enter the HTTP Web Path to continue.</font></td>
				</tr>
		");
	}
if (isset($e12))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>You must enter the Base Server Path to continue.</font></td>
				</tr>
		");
	}
if (isset($e13))
	{
	echo("
				<tr>
					<td colspan='2'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>You must enter the AutoPilot Data Directory Path to continue.</font></td>
				</tr>
		");
	}
if (isset($e0)||isset($e1)||isset($e2)||isset($e3)||isset($e4)
||isset($e5)||isset($e6)||isset($e7)||isset($e8)||isset($e9)
||isset($e10)||isset($e11)||isset($e12)||isset($e13))
	{
	echo("
				<tr>
					<td colspan='2'><hr color='#F7F3F7'></td>
				</tr>
		");
	}
echo("
				<tr>
					<td colspan='2' align='left' valign='middle'><b>General Variables</b></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Default Site Title:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='site_title' value='".((isset($site_title))?"".$site_title."":"".$input0."")."' onFocus=\"if(this.value=='".$input0."') this.value='';\" onBlur=\"if(this.value=='') this.value='".$input0."';\"></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Default Site Name:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='site_name' value='".((isset($site_name))?"".$site_name."":"".$input1."")."' onFocus=\"if(this.value=='".$input1."') this.value='';\" onBlur=\"if(this.value=='') this.value='".$input1."';\"></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;System Email Address:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='email_support' value='".((isset($email_support))?"".$email_support."":"")."' onFocus=\"if(this.value=='".$input2."') this.value='';\" onBlur=\"if(this.value=='') this.value='".$input2."';\"></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Minimum Affiliate Payout:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='balance_required_for_payment' value='".((isset($balance_required_for_payment))?"".$balance_required_for_payment."":"$50")."'></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Currency:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='currency' value='".((isset($currency))?"".$currency."":"$")."'></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Currency Type:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='currency_type' value='".((isset($currency_type))?"".$currency_type."":"USD")."'></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Charge for Domain Name Orders:</td>
					<td width='75%' align='left' valign='middle'><select name='domain_fee' ".$input_style.">
					<option value='0'".(($domain_fee==0)?" selected":"").">at time of order, added into total.</option>
					<option value='1'".(($domain_fee==1)?" selected":"").">in a seperate billable service invoice.</option>
					</select></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Enable Domain Expire Check:</td>
					<td width='75%' align='left' valign='middle'><select name='run_domain_expire' ".$input_style.">
					<option value='yes'".(($run_domain_expire=="yes")?" selected":"").">Yes</option>
					<option value='no'".(($run_domain_expire=="no")?" selected":"").">No</option>
					</select></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Create Invoices:</td>
					<td width='75%' align='left' valign='middle'><select name='invoice_notice_period' ".$input_style.">
	");
for ($i=1; $i<=30; $i++)
	{
	echo "<option value='".($i*(3600*24))."'".(($invoice_notice_period==($i*(3600*24)))?" selected":"").">".$i." day".(($i==1)?"":"s")." before the account will be charged.</option>\n";
	}
echo("
					</select></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Send Hosting Invoice Reminders:</td>
					<td width='75%' align='left' valign='middle'><input type='checkbox' name='send_reminders' value='1'".(($send_reminders==1)?" checked":"")." id='send_reminders'> <label for='send_reminders'>Yes</label></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Incomplete Orders Saved For:</td>
					<td width='75%' align='left' valign='middle'><select name='session_expire' ".$input_style.">
	");
for ($i=12; $i<=168; $i++)
	{
	echo "<option value='".$i."'".(($session_expire==$i)?" selected":"").">".$i." hour".(($i==1)?"":"s")."</option>\n";
	}
echo("
					</select></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Default Language:</td>
					<td width='75%' align='left' valign='middle'><select name='local_lang' ".$input_style.">
	");
$available_languages=available_languages($server_inc);
$ct=(substr_count($available_languages, "|")-1);
$arr=explode("|", $available_languages);
for ($i=0; $i<=$ct; $i++)
	{
	$first=strtoupper(substr($arr[$i], 0, 1));
	$rest=substr($arr[$i], -(strlen($arr[$i])-1));
	echo "<option value='".$arr[$i]."'".(($local_lang==$arr[$i])?" selected":"").">".$first."".$rest."</option>\n";
	}
echo("
					</select></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='top'>&nbsp;AutoPilot License:</td>
					<td width='75%' align='left' valign='middle'><textarea name='license' rows='2' cols='50'".$input_style.">".$license."</textarea></td>
				</tr>
				<!--- <tr>
					<td colspan='2' align='left' valign='middle'>&nbsp;</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='middle'><b>Create Default Admin Account</b></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;System Email Address:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='email_admin' value='".((isset($email_admin))?"".$email_admin."":"")."'></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Admin Username:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='username' value='".((isset($username))?"".$username."":"")."'></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Admin Password:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='password' value='".((isset($password))?"".$password."":"")."'></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Verify Password:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='password1' value='".((isset($password1))?"".$password1."":"")."'></td>
				</tr>--->
				<tr>
					<td colspan='2' align='left' valign='middle'>&nbsp;</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='middle'><b>Enom Configuration</b></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Enom Integration:</td>
					<td width='75%' align='left' valign='middle'><input type='checkbox' name='use_enom' value='1' id='enom'".(($use_enom==1)?" checked":"")."> <label for='enom'>Check to activate Enom integration.</label></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='top'>&nbsp;Enom Username:</td>
					<td width='75%' align='left' valign='top'><input size='50' maxlength='255' ".$input_style." type='text' name='enom_user' value='".((isset($enom_user))?"".$enom_user."":"")."'></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='top'>&nbsp;Enom Password:</td>
					<td width='75%' align='left' valign='top'><input size='50' maxlength='255' ".$input_style." type='text' name='enom_pass' value='".((isset($enom_pass))?"".$enom_pass."":"")."'></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='top'>&nbsp;Registered IP:</td>
					<td width='75%' align='left' valign='top'><input size='50' maxlength='255' ".$input_style." type='text' name='enom_ip' value='".((isset($enom_ip))?"".$enom_ip."":"")."'></td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='middle'>&nbsp;</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='middle'><b>Main Resolver Configuration</b></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='top'>&nbsp;Resolver Functionality:</td>
					<td width='75%' align='left' valign='top'><input type='radio' name='resolve_works' value='0' id='resolve_works0'".(($resolve_works==0)?" checked":"")." onclick='this.form.cont_resolve.disabled=true; this.form.resolve_server.disabled=true;'> <label for='resolve_works0'>Auto-Resolve on first cron run after inital order</label></td>
				</tr>
	");

if (can_i_use_nslookup_via_php()==0)
	{
	echo("
				<tr>
					<td width='25%' align='left' valign='middle'></td>
					<td width='75%' align='left' valign='middle'><input type='radio' name='resolve_works' value='1' id='resolve_works1'".(($resolve_works==1)?" checked":"")." onclick='this.form.cont_resolve.disabled=false; this.form.resolve_server.disabled=false;'> <label for='resolve_works1'>Use \"nslookup\" for resolve check</label></td>
				</tr>
		");
	}

echo("
				<tr>
					<td width='25%' align='left' valign='middle'></td>
					<td width='75%' align='left' valign='middle'><input type='radio' name='resolve_works' value='2' id='resolve_works2'".(($resolve_works==2)?" checked":"")." onclick='this.form.cont_resolve.disabled=false; this.form.resolve_server.disabled=false;'> <label for='resolve_works2'>Use \"gethostbyname\" for resolve check</label></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'></td>
					<td width='75%' align='left' valign='middle'>
					<table width='100%' cellpadding='0' cellspacing='0' border='0'>
						<tr>
							<td width='1%' align='left' align='top' valign='middle'><img src='".$http_images."/space.gif' width='250' height='1'></td>
							<td width='99%' align='left' align='top' valign='middle'></td>
						</tr>
						<tr>
							<td width='1%' align='left' align='top' valign='middle'>Continue to check resolve after the inital resolve?</td>
							<td width='99%' align='left' align='top' valign='middle'><select name='cont_resolve' ".$input_style." ".(($resolve_works==0)?" disabled":"").">
					<option value='0'".(($cont_resolve==0)?" selected":"").">No</option>
					<option value='1'".(($cont_resolve==1)?" selected":"").">Yes</option>
					</select></td>
						</tr>
						<tr>
							<td width='1%' align='left' align='top' valign='middle'><img src='".$http_images."/space.gif' width='250' height='1'></td>
							<td width='99%' align='left' align='top' valign='middle'></td>
						</tr>
					</table>
					</td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='top'>&nbsp;Resolve Server:</td>
					<td width='75%' align='left' valign='top'><input size='50' maxlength='255' ".$input_style." type='text' name='resolve_server' value='".((isset($resolve_server))?"".$resolve_server."":"".$input3."")."' onFocus=\"if(this.value=='".$input3."') this.value='';\" onBlur=\"if(this.value=='') this.value='".$input3."';\" ".(($resolve_works==0)?" disabled":"")."><br><font color='#990000'>^^ Note: This IP / Hostname CANNOT BE IN YOUR NETWORK ^^</font></td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='middle'>&nbsp;</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='middle'><b>Define File Paths</b></td>
				</tr>
	");

if (ereg("http://", $_SERVER['SERVER_NAME'])!=true) { $guess_http_web="http://".$_SERVER['SERVER_NAME']; }
else { $guess_http_web=$_SERVER['SERVER_NAME']; } 

$guess_http_web=str_replace("www.", "", $guess_http_web);
$guess_http_web.=str_replace("/inc/install2.php", "", $_SERVER['PHP_SELF']);
$guess_root_path=str_replace("/inc/install2.php", "", $HTTP_SERVER_VARS['PATH_TRANSLATED']);

$gg=0;
$tok=strtok($guess_root_path, "/");
while ($tok)
	{
	if ($gg==0||$gg==1) { $guess_absolute_path.="/".$tok; }
	else { $guess_absolute_path.="/mib_data"; break; }
	$gg+=1;
	$tok=strtok("/");
	}

$guess_absolute_path;

echo("
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;HTTP Web Path:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='http_web' value='".((isset($http_web))?"".$http_web."":"".$guess_http_web."")."'></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Terms of Service Agreement:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='tos_agreement' value='".((isset($tos_agreement))?"".$tos_agreement."":"")."'></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Base Server Path:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='server_root' value='".((isset($server_root))?"".$server_root."":"".$guess_root_path."")."'></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;AutoPilot Data Directory:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='below_public' value='".((isset($below_public))?"".$below_public."":"".$guess_absolute_path."")."'></td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='middle'>&nbsp;</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='middle'><b>Resellers Only</b></td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'>&nbsp;Default cPanel Theme:</td>
					<td width='75%' align='left' valign='middle'><input size='50' maxlength='255' ".$input_style." type='text' name='default_reseller_cpanel_theme' value='".((isset($default_reseller_cpanel_theme))?"".$default_reseller_cpanel_theme."":"")."'></td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='middle'>&nbsp;</td>
				</tr>
				<tr>
					<td width='25%' align='left' valign='middle'></td>
					<td width='75%' align='left' valign='middle'><input ".$button_style." type='submit' name='submit' value='Save Changes'></td>
				</tr>
			</table>
			</form>
			
			</td>
		</tr>
	</table>
	");

include $server_admin_inc."/footer.php";
mysql_close($dblink);
?>