header("Pragma: no-cache");
header("Expires: 0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
$user = new usersMenus();
if (!$user->AsSquidAdministrator) {
    $tpl = new templates();
    echo "alert('" . $tpl->javascript_parse_text("{ERROR_NO_PRIVS}") . ");";
    exit;
}
if (isset($_GET["popup-group"])) {
    popup_group();
    exit;
}
if (isset($_GET["choose-group"])) {
    groups_fields();
    exit;
}
if (isset($_GET["popup-members"])) {
    group_members();
    exit;
}
if (isset($_GET["RuleID"])) {
    save();
    exit;
}
if (isset($_GET["show-membrs"])) {
    group_members_js();
    exit;
}
if (isset($_GET["delete-js"])) {
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
	header("Cache-Control: no-cache, must-revalidate");	
	$user=new usersMenus();
	if(!$user->AsSquidAdministrator){
		$tpl=new templates();
		echo "alert('".$tpl->javascript_parse_text("{ERROR_NO_PRIVS}").");";
		exit;
		
	}
	if(isset($_GET["add-ldap-group"])){save_group();exit;}
	if(isset($_GET["popup-index"])){popup_index();exit;}
	if(isset($_GET["table"])){table_list();exit;}
	if(isset($_GET["add-ip-addr"])){table_add_ips();exit;}
	if(isset($_GET["del-ip-addr"])){table_del_ips();exit;}
	if(isset($_GET["popup-group"])){popup_group();exit;}
	if(isset($_GET["choose-group"])){groups_fields();exit;}
	
	
popup();

function popup(){
	$page=CurrentPageName();
	$html="<div id='mainDansRulesPanel'></div>
	
	<script>
		function ResfreshMainDansRulesPanel(){
			LoadAjax('mainDansRulesPanel','$page?popup-index=yes')
		}
		ResfreshMainDansRulesPanel();
	</script>
	";