<?php
include(dirname(__FILE__)."/require.php");
if($ppurview[1]!=1)
  jump("jump.php?id=25&jump=main.php");
if(isset($_GET['action']) and $_GET['action'] == "submit")
{
  $str = "<?php\n";
  foreach($_POST AS $key=>$val)
  {
	$val=str_replace('"','*',$val);
	$val=html_replacef($val);
    $str.= "$".$key."=\"".$val."\";\n";
  }
  $str.= "?>";
  $filename='../configs/config.php';
  @chmod($filename,0777);
  if (is_writable($filename)) 
  { 
    if (!$handle=fopen($filename,'w') or fwrite($handle, $str) === FALSE)
      Header("Location: jump.php?id=error&jump=config.php");
	else
	  Header("Location: jump.php?id=24&jump=config.php");
	fclose($handle);
  }
  else
    jump("jump.php?id=13&jump=config.php");
  exit();
}
$core_flow=str_replace('*','"',$core_flow);
$phpcolor->table="style";
$phpcolor->field="*";
$phpcolor->where="type=1";
$style=$phpcolor->assignment();
$servertime=date('Y-m-d H:i:s');
$bartime=date('Y-m-d H:i:s',strtotime(date('Y-m-d H:i:s'))+$core_time*3600);
$tpl -> assign("core_bartype", $core_bartype);
$tpl -> assign("core_listcon", $core_listcon);
$tpl -> assign("core_visitorurl", $core_visitorurl);
$tpl -> assign("core_yjcm", $core_yjcm);
$tpl -> assign("core_yjcmdb", $core_yjcmdb);
$tpl -> assign("core_twodown", $core_twodown);
$tpl -> assign("core_barmgl", $core_barmgl);
$tpl -> assign("core_atnum", $core_atnum);
$tpl -> assign("core_wapbaropen", $core_wapbaropen);
$tpl -> assign("servertime", $servertime);
$tpl -> assign("bartime", $bartime);
$tpl -> assign("style", $style);
$tpl -> assign("core_barname", $core_barname);
$tpl -> assign("core_url", $core_url);
$tpl -> assign("core_keyword", $core_keyword);
$tpl -> assign("core_description", $core_description);
$tpl -> assign("core_icp", $core_icp);
$tpl -> assign("core_style", $core_style);
$tpl -> assign("core_baropen", $core_baropen);
$tpl -> assign("core_opentime1", $core_opentime1);
$tpl -> assign("core_opentime2", $core_opentime2);
$tpl -> assign("core_closed", $core_closed);
$tpl -> assign("core_time", $core_time);
$tpl -> assign("core_rewrite", $core_rewrite);
$tpl -> assign("core_createopen", $core_createopen);
$tpl -> assign("core_createaudit", $core_createaudit);
$tpl -> assign("core_useropen", $core_useropen);
$tpl -> assign("core_userheadup", $core_userheadup);
$tpl -> assign("core_useraudit", $core_useraudit);
$tpl -> assign("core_usershort", $core_usershort);
$tpl -> assign("core_userlong", $core_userlong);
$tpl -> assign("core_pwdshort", $core_pwdshort);
$tpl -> assign("core_pwdlong", $core_pwdlong);
$tpl -> assign("core_signlong", $core_signlong);
$tpl -> assign("core_filteruser", $core_filteruser);
$tpl -> assign("core_listpage", $core_listpage);
$tpl -> assign("core_readpage", $core_readpage);
$tpl -> assign("core_filesize", $core_filesize);
$tpl -> assign("core_visitoropen", $core_visitoropen);
$tpl -> assign("core_themeshort", $core_themeshort);
$tpl -> assign("core_themelong", $core_themelong);
$tpl -> assign("core_contentshort", $core_contentshort);
$tpl -> assign("core_contentlong", $core_contentlong);
$tpl -> assign("core_barmastercount", $core_barmastercount);
$tpl -> assign("core_barsmastercount", $core_barsmastercount);
$tpl -> assign("core_ubarmastercount", $core_ubarmastercount);
$tpl -> assign("core_ubarsmastercount", $core_ubarsmastercount);
$tpl -> assign("core_createclass", $core_createclass);
$tpl -> assign("core_file", $core_file);
$tpl -> assign("core_filetype", $core_filetype);
$tpl -> assign("core_vreg", $core_vreg);
$tpl -> assign("core_vlogin", $core_vlogin);
$tpl -> assign("core_vbar", $core_vbar);
$tpl -> assign("core_vlostpw", $core_vlostpw);
$tpl -> assign("core_vpost", $core_vpost);
$tpl -> assign("core_vrepost", $core_vrepost);
$tpl -> assign("core_rmtime", $core_rmtime);
$tpl -> assign("core_stmpopen", $core_stmpopen);
$tpl -> assign("core_stmpserver", $core_stmpserver);
$tpl -> assign("core_stmpport", $core_stmpport);
$tpl -> assign("core_stmpmail", $core_stmpmail);
$tpl -> assign("core_stmpacc", $core_stmpacc);
$tpl -> assign("core_stmppwd", $core_stmppwd);
$tpl -> assign("core_scode", $core_scode);
$tpl -> assign("core_flow", $core_flow);
$tpl -> assign("core_wflow", $core_wflow);
$tpl -> assign("core_usercode", $core_usercode);
$tpl -> assign("core_gfbarid", $core_gfbarid);
$tpl -> assign("core_gfbarm", $core_gfbarm);
$tpl -> display("config.htm");
?>