Exemple #1
0
function download_system_rules_data()
{
    $rid = intval($_GET['id']);
    if (!$rid) {
        return 'error';
    }
    $rpcClient = rpcClient();
    $client_info = get_client_info();
    $re = $rpcClient->download_data('rule', $rid, $client_info);
    if (is_object($re) || $re->Number == 0) {
        if ($re->Message) {
            return milu_lang('phprpc_error', array('msg' => $re->Message));
        }
        $re = (array) $re;
    }
    if ($re) {
        $re = serialize_iconv($re);
        rules_add($re);
        return 'ok';
    } else {
        return 0;
    }
}
Exemple #2
0
if ($user->AsSquidAdministrator == false) {
    $tpl = new templates();
    echo "alert('" . $tpl->javascript_parse_text("{ERROR_NO_PRIVS}") . "');";
    die;
    exit;
}
if (isset($_GET["js"])) {
    js();
    exit;
}
if (isset($_GET["rules"])) {
    rules_popup();
    exit;
}
if (isset($_GET["rules-add"])) {
    rules_add();
    exit;
}
if (isset($_GET["rules-del"])) {
    rules_del();
    exit;
}
if (isset($_GET["rule_name"])) {
    rules_save();
    exit;
}
if (isset($_GET["rule-id"])) {
    rule_panel();
    exit;
}
if (isset($_GET["acl-time"])) {
Exemple #3
0
function pick_match_rules()
{
    $url = format_url($_GET['url']);
    d_s();
    $content = get_contents($url);
    $v = match_rules($url, $content, 2, 0);
    if (!$v || !is_array($v)) {
        $v = pick_match_coloud_rules($url);
        if ($v['data_type'] == 1) {
            pload('F:rules');
            $v = $v['data'];
            rules_add($v);
            del_search_index(2);
        }
    }
    if (!$v || !is_array($v)) {
        return 'no';
    }
    $re_arr = array($v['rules_type'], $v['rules_hash']);
    return json_encode($re_arr);
}
	if(isset($_GET["js"])){js();exit;}

	if(isset($_POST["choose-acl-rule"])){browse_acl_rule_save();exit;}
	
	if(isset($_GET["BandExplainRuleClass"])){bandwith_rule_class_explain();exit;}
	if(isset($_GET["rules"])){rules_popup();exit;}
	if(isset($_GET["rules-add"])){rules_add();exit;}
	if(isset($_GET["rules-del"])){rules_del();exit;}
	if(isset($_GET["rule_name"])){rules_save();exit;}
	if(isset($_GET["rule-id"])){rule_panel();exit;}
	
	
	if(isset($_GET["bandwith-rules-list"])){bandwith_rules_list();exit;}
	if(isset($_GET["bandwith-rule-js"])){bandwith_rule_js();exit;}
	if(isset($_GET["bandwith-rule-tabs"])){bandwith_rule_tabs();exit;}
	if(isset($_GET["bandwith-rule-parameters"])){rules_add();exit;}
	
	if(isset($_GET["bandwith-rule-networks"])){acl_net_popup();exit;}
	if(isset($_GET["bandwith-rule-websites"])){acl_www_popup();exit;}
	if(isset($_GET["bandwith-rule-files"])){acl_file_popup();exit;}
	if(isset($_GET["bandwith-rule-time"])){acl_time();exit;}
	
	if(isset($_GET["bandwith-rule-pobjects"])){acl_net_pobjects();exit;}
	if(isset($_GET["acl-group-add"])){acl_net_pobjects_add();exit;}
	if(isset($_GET["by-acls-js"])){byacls_js();exit;}
	if(isset($_GET["browser-acl-js"])){browser_acl_js();exit;}
	
	
	
	if(isset($_GET["bandwith-acl-list"])){bandwith_table_list();exit;}
	if(isset($_POST["acl-delete-item"])){bandwith_table_delete_item();exit;}
Exemple #5
0
	include_once('ressources/class.cron.inc');
	include_once('ressources/class.squid.bandwith.inc');
	
	
	$user=new usersMenus();
	if($user->AsSquidAdministrator==false){
		$tpl=new templates();
		echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
		die();exit();
	}
	
	if(isset($_GET["js"])){js();exit;}

	
	if(isset($_GET["rules"])){rules_popup();exit;}
	if(isset($_GET["rules-add"])){rules_add();exit;}
	if(isset($_GET["rules-del"])){rules_del();exit;}
	if(isset($_GET["rule_name"])){rules_save();exit;}
	if(isset($_GET["rule-id"])){rule_panel();exit;}
	
	if(isset($_GET["acl-time"])){acl_time();exit;}
	if(isset($_GET["bandacltime_ID"])){acl_time_save();exit;}
	
	if(isset($_GET["acl-net"])){acl_net_popup();exit;}
	if(isset($_GET["acl-net-popup-add"])){acl_net_add_popup();exit;}
	if(isset($_GET["acl-net-add"])){acl_net_add();exit;}
	if(isset($_GET["acl-net-del"])){acl_net_del();exit;}
	if(isset($_GET["acl-net-list"])){acl_net_list();exit;}
	if(isset($_GET["acl-net-enable"])){acl_net_enabled();exit;}
	
	if(isset($_GET["acl-www"])){acl_www_popup();exit;}
	include_once('ressources/class.squid.inc');
	
	
$usersmenus=new usersMenus();
if(!$usersmenus->AsDansGuardianAdministrator){
	$tpl=new templates();
	$alert=$tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
	echo "alert('$alert');";
	die();	
}




if(isset($_GET["list"])){rules_list();exit;}
if(isset($_POST["rule-add"])){rules_add();exit;}
if(isset($_POST["rule-delete"])){rules_delete();exit;}
if(isset($_POST["rule-enable"])){rules_enable();exit;}
if(isset($_GET["change-rule-name-js"])){rules_changename_js();exit;}
if(isset($_POST["rule-edit"])){rules_edit();exit;}

if(isset($_GET["rules-link-js"])){rules_link_js();exit;}
if(isset($_GET["rule-link"])){rules_link_popup();exit;}
if(isset($_GET["rule-link-list"])){rules_link_list();exit;}

if(isset($_GET["rules-browse-js"])){rules_browse_js();exit;}
if(isset($_GET["rules-browse-list"])){rules_browse_list();exit;}
if(isset($_GET["rules-browse-popup"])){rules_browse_popup();exit;}
if(isset($_POST["rule-link-add"])){rules_link_add();exit;}
if(isset($_POST["rule-link-enable"])){rules_link_enable();exit;}
if(isset($_POST["rule-link-unlink"])){rules_link_delete();exit;}