include_once(dirname(__FILE__) . '/ressources/class.system.network.inc');
include_once(dirname(__FILE__) . '/ressources/class.squid.inc');


$user=new usersMenus();
if($user->AsSquidAdministrator==false){
	$tpl=new templates();
	echo "alert('".$tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
	die();
}

if(isset($_GET["popup"])){popup();exit;}
if(isset($_GET["step1"])){step1();exit;}
if(isset($_GET["step2"])){step2();exit;}
if(isset($_POST["rulename"])){Save();exit;}
if(isset($_POST["html"])){SaveMysql();exit;}



js();

function js(){
	header("content-type: application/x-javascript");
	$tpl=new templates();
	$page=CurrentPageName();
	$t=time();
	$tpl=new templates();
	$title=$tpl->javascript_parse_text("Hyper Cache: {new_rule}");
	

	echo "
    exit;
}
if (isset($_GET["step1"])) {
    step1();
    exit;
}
if (isset($_GET["step2"])) {
    step2();
    exit;
}
if (isset($_POST["rulename"])) {
    Save();
    exit;
}
if (isset($_POST["html"])) {
    SaveMysql();
    exit;
}
js();
function js()
{
    header("content-type: application/x-javascript");
    $tpl = new templates();
    $page = CurrentPageName();
    $t = time();
    $tpl = new templates();
    $title = $tpl->javascript_parse_text("Hyper Cache: {new_rule}");
    echo "\n\tfunction Start{$t}(){\n\tRTMMail('800','{$page}?popup=yes','{$title}');\n}\nStart{$t}();";
}
function popup()
{