当前位置: 首页>>代码示例>>PHP>>正文


PHP mysql_squid_builder::check_hotspot_tables方法代码示例

本文整理汇总了PHP中mysql_squid_builder::check_hotspot_tables方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql_squid_builder::check_hotspot_tables方法的具体用法?PHP mysql_squid_builder::check_hotspot_tables怎么用?PHP mysql_squid_builder::check_hotspot_tables使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mysql_squid_builder的用法示例。


在下文中一共展示了mysql_squid_builder::check_hotspot_tables方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: wifidog_register_perform

function wifidog_register_perform()
{
    session_start();
    $page = CurrentPageName();
    $autocreate_confirmed = 0;
    if ($GLOBALS["HOTSPOT_DEBUG"]) {
        ToSyslog("Starting wifidog_register_perform()");
    }
    $sock = new sockets();
    $ArticaHotSpotSMTP = SMTP_SETTINGS();
    $email = trim(strtolower($_POST["email"]));
    $q = new mysql_squid_builder();
    $password2 = trim($_POST["password2"]);
    $password = trim($_POST["password"]);
    if ($password2 != $password) {
        return wifidog_register("{password_mismatch}");
    }
    if ($ArticaHotSpotSMTP["ENABLED_SMTP"] == 1) {
        if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
            return wifidog_register("{error_email_invalid}");
        }
        $tr = explode("@", $email);
        $domain = $tr[1];
        if (!checkdnsrr($domain, 'MX')) {
            return wifidog_register("&laquo;{$domain}&raquo;<br>{error_domain_email_invalid}");
        }
    }
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT uid FROM hotspot_members WHERE `uid`='{$email}'"));
    $wifidog_build_uri = wifidog_build_uri();
    $uriext = $wifidog_build_uri[0];
    $HiddenFields = $wifidog_build_uri[1];
    if ($ligne["uid"] != null) {
        if ($ArticaHotSpotSMTP["ENABLED_SMTP"] == 1) {
            $link = "<center><a href=\"{$page}?wifidog-recover=yes&{$uriext}\">{lost_password}</a></center>";
        }
        return wifidog_register("{this_account_already_exists}<hr>{$link}");
    }
    $MAC = $_REQUEST["mac"];
    $REGISTER_MAX_TIME = $ArticaHotSpotSMTP["REGISTER_MAX_TIME"];
    $ArticaSplashHotSpotEndTime = $ArticaHotSpotSMTP["ArticaSplashHotSpotEndTime"];
    $password = md5($password);
    $creationtime = time();
    $autocreate_maxttl = $ArticaHotSpotSMTP["REGISTER_MAX_TIME"];
    $sessionkey = md5($password . $creationtime . $email);
    $gateway_addr = $_REQUEST["gw_address"];
    $gw_port = $_REQUEST["gw_port"];
    $gw_id = $_REQUEST["gw_id"];
    $ARP = $_REQUEST["mac"];
    $url = $_REQUEST["url"];
    $token = $_REQUEST["token"];
    if ($ArticaHotSpotSMTP["ENABLED_SMTP"] == 0) {
        $autocreate_confirmed = 1;
    }
    if ($GLOBALS["HOTSPOT_DEBUG"]) {
        ToSyslog("Create new member {$email},{$password},TTL:{$ArticaSplashHotSpotEndTime} in line:" . __LINE__);
    }
    $sql = "INSERT IGNORE INTO hotspot_members \n\t(uid,ttl,sessiontime,password,enabled,creationtime,autocreate,autocreate_confirmed,autocreate_maxttl,sessionkey,MAC) VALUES\n\t('{$email}','{$ArticaSplashHotSpotEndTime}','','{$password}',1,'{$creationtime}',1,'{$autocreate_confirmed}',{$autocreate_maxttl},'{$sessionkey}','{$MAC}')";
    $q->QUERY_SQL($sql);
    if (!$q->ok) {
        if (strpos(" {$q->mysql_error}", "Unknown column") > 0) {
            if ($GLOBALS["HOTSPOT_DEBUG"]) {
                ToSyslog("check_hotspot_tables in line:" . __LINE__);
            }
            $q->check_hotspot_tables();
            if (!$q->ok) {
                if ($GLOBALS["HOTSPOT_DEBUG"]) {
                    ToSyslog("{$q->mysql_error} in line:" . __LINE__);
                }
            }
            $q->QUERY_SQL($sql);
        }
    }
    if (!$q->ok) {
        ToSyslog("{$q->mysql_error}");
        return wifidog_register($q->mysql_error);
    }
    if ($ArticaHotSpotSMTP["ENABLED_SMTP"] == 0) {
        $array["SERVER_NAME"] = $_SERVER["SERVER_NAME"];
        $array["redirecturi"] = $url;
        $array["LOGIN"] = $email;
        $array["redirecturi"] = $_REQUEST["url"];
        $array["REMOTE_ADDR"] = $_REQUEST["ip"];
        $array["token"] = $token;
        $array["HOST"] = $_REQUEST["ip"];
        UnLock($array);
        ToSyslog("wifidog_auth/" . __FUNCTION__ . ":: SESSION(HOTSPOT_REDIRECT_URL) = {$url}");
        $_SESSION["HOTSPOT_AUTO_REGISTER"] = true;
        $_SESSION["HOTSPOT_REDIRECT_URL"] = $url;
        $redirecturi = "http://{$gateway_addr}:{$gw_port}/wifidog/auth?token={$token}";
        ToSyslog("wifidog_auth/" . __FUNCTION__ . ":: Redirect Token: {$token} to {$redirecturi}");
        header("Location: {$redirecturi}");
        return;
    }
    $proto = "http";
    $myHostname = $_SERVER["HTTP_HOST"];
    $page = CurrentPageName();
    if (isset($_SERVER["HTTPS"])) {
        $proto = "https";
    }
    $URL_REDIRECT = "{$proto}://{$myHostname}/{$page}?wifidog-confirm={$sessionkey}";
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:hotspot.php

示例2: table

function table()
{
    $today = date("Y-m-d");
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $TB_HEIGHT = 500;
    $TB_WIDTH = 710;
    $members = $tpl->javascript_parse_text("{members}");
    $MAC = $tpl->javascript_parse_text("{MAC}");
    $ttl = $tpl->javascript_parse_text("{ttl}");
    $finaltime = $tpl->javascript_parse_text("{re_authenticate_each}");
    $endtime = $tpl->javascript_parse_text("{endtime}");
    $q = new mysql_squid_builder();
    if (!$q->TABLE_EXISTS("hotspot_activedirectory")) {
        $q->check_hotspot_tables();
    }
    $q->QUERY_SQL("DELETE FROM `hotspot_activedirectory` WHERE ruleid=0");
    $hostname = $tpl->javascript_parse_text("{hostname}");
    $enabled = $tpl->javascript_parse_text("{enabled}");
    $new_connection = $tpl->javascript_parse_text("{new_connection}");
    $parameters = $tpl->javascript_parse_text("{parameters}");
    $delete = $tpl->javascript_parse_text("{delete}");
    $created = $tpl->javascript_parse_text("{created}");
    $title = $tpl->javascript_parse_text("{hotspot_ad_title}");
    $buttons = "\n\tbuttons : [\n\t{name: '<strong style=font-size:18px>{$new_connection}</strong>', bclass: 'Add', onpress : NewCNx{$t}},\n\t\n\t],";
    $html = "\n\t<div id='query-explain'></div>\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:99%'></table>\n\t<script>\n\tvar mem{$t}='';\n\t\$(document).ready(function(){\n\t\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?items=yes&t={$t}&ruleid={$_GET["ruleid"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '<span style=font-size:18px>{$hostname}</span>', name : 'hostname', width :515, sortable : true, align: 'left'},\n\t{display: '<span style=font-size:18px>{$enabled}</span>', name : 'enabled', width :98, sortable : false, align: 'center'},\n\t{display: '&nbsp;', name : 'none', width :55, sortable : true, align: 'center'},\n\t],\n\t{$buttons}\n\t\n\tsearchitems : [\n\t{display: '{$hostname}', name : 'hostname'},\n\t\n\t],\n\tsortname: 'hostname',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '<span style=font-size:22px>{$title}</span>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 550,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200,500]\n\t\n\t});\n\t});\n\n\n\t\n\tfunction NewCNx{$t}(){\n\t\tLoadjs('{$page}?popup-ad-js=yes&md5=&t={$t}&ruleid={$_GET["ruleid"]}');\n\t}\n</script>";
    echo $html;
}
开发者ID:articatech,项目名称:artica,代码行数:30,代码来源:squid.webauth.activedirectory.php

示例3: table

function table(){
	$page=CurrentPageName();
	$tpl=new templates();
	$tt=time();
	$t=$_GET["t"];
	$_GET["ruleid"]=$_GET["ID"];
	$groups=$tpl->javascript_parse_text("{groups}");
	$from=$tpl->_ENGINE_parse_body("{from}");
	$to=$tpl->javascript_parse_text("{to}");
	$rule=$tpl->javascript_parse_text("{rule}");
	$delete=$tpl->javascript_parse_text("{delete} {zone} ?");
	$rewrite_rules_fdb_explain=$tpl->javascript_parse_text("{rewrite_rules_fdb_explain}");
	$new_network=$tpl->javascript_parse_text("{new_rule}");
	$comment=$tpl->javascript_parse_text("{comment}");
	$rules=$tpl->javascript_parse_text("{rules}");
	$rule=$tpl->javascript_parse_text("{rule}");
	$apply=$tpl->javascript_parse_text("{apply}");
	$action=$tpl->javascript_parse_text("{action}");
	$order=$tpl->javascript_parse_text("{order}");
	$networks=$tpl->javascript_parse_text("{networks}");
	$restricted=$tpl->javascript_parse_text("{restricted}");
	$type=$tpl->javascript_parse_text("{type}");
	$protocol=$tpl->javascript_parse_text("{protocol}");
	$port=$tpl->javascript_parse_text("{port}");
	$trusted_MAC=$tpl->javascript_parse_text("{trusted_MAC}");
	$trusted_sslwebsites=$tpl->javascript_parse_text("{trusted_ssl_sites}");
	$title=$networks;
	$tt=time();
	$q=new mysql_squid_builder();
	$q->check_hotspot_tables();
	
	$buttons="
	buttons : [
	{name: '$new_network', bclass: 'add', onpress : NewRule$tt},
	{name: '$trusted_MAC', bclass: 'Settings', onpress : rports},
	{name: '$trusted_sslwebsites', bclass: 'Settings', onpress : rssls},
	{name: '$apply', bclass: 'Reconf', onpress : Apply$tt},
	],";

	$html="
	<table class='flexRT$tt' style='display: none' id='flexRT$tt' style='width:100%'></table>
	<script>
	function Start$tt(){
	$('#flexRT$tt').flexigrid({
	url: '$page?items=yes&t=$tt&tt=$tt&t-rule={$_GET["t"]}&ruleid={$_GET["ruleid"]}',
	dataType: 'json',
	colModel : [
	{display: '$order', name : 'zorder', width :55, sortable : true, align: 'center'},
	{display: '$protocol', name : 'proto', width :55, sortable : true, align: 'center'},
	{display: '$networks', name : 'pattern', width :448, sortable : true, align: 'left'},
	{display: '$type', name : 'hotspoted', width :100, sortable : false, align: 'center'},
	{display: '$action', name : 'action', width :100, sortable : true, align: 'center'},
	{display: 'up', name : 'up', width :55, sortable : false, align: 'center'},
	{display: 'down', name : 'down', width :55, sortable : false, align: 'center'},
	{display: '&nbsp;', name : 'delete', width : 100, sortable : false, align: 'center'},
	],
	$buttons
	searchitems : [
	{display: '$networks', name : 'pattern'},
	{display: '$port', name : 'port'},
	],
	sortname: 'zorder',
	sortorder: 'asc',
	usepager: true,
	title: '$title',
	useRp: true,
	rp: 50,
	showTableToggleBtn: false,
	width: '99%',
	height: 450,
	singleSelect: true,
	rpOptions: [10, 20, 30, 50,100,200]

});
}

var xNewRule$tt= function (obj) {
	var res=obj.responseText;
	if (res.length>3){alert(res);return;}
	$('#flexRT$t').flexReload();
	$('#flexRT$tt').flexReload();
}

function Apply$tt(){
	Loadjs('squid.webauth.restart.php');
}


function NewRule$tt(){
	Loadjs('$page?item-js=yes&ID=0&t=$tt',true);
}
function Delete$tt(zmd5){
	if(confirm('$delete')){
		var XHR = new XHRConnection();
		XHR.appendData('policy-delete', zmd5);
		XHR.sendAndLoad('$page', 'POST',xNewRule$tt);
	}
}

var xINOUT$tt= function (obj) {
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:squid.webauth.hotspots.php

示例4: table

function table(){
	$today=date("Y-m-d");
	$t=time();
	$page=CurrentPageName();
	$tpl=new templates();
	$users=new usersMenus();
	$TB_HEIGHT=500;
	$TB_WIDTH=710;
	$members=$tpl->javascript_parse_text("{members}");
	$MAC=$tpl->javascript_parse_text("{MAC}");
	$ttl=$tpl->javascript_parse_text("{ttl}");
	$finaltime=$tpl->javascript_parse_text("{re_authenticate_each}");
	$endtime=$tpl->javascript_parse_text("{endtime}");
	
	$q=new mysql_squid_builder();
	if(!$q->TABLE_EXISTS("hotspot_activedirectory")){$q->check_hotspot_tables();}
	
	$hostname=$tpl->javascript_parse_text("{hostname}");
	$enabled=$tpl->javascript_parse_text("{enabled}");
	$new_connection=$tpl->javascript_parse_text("{new_connection}");
	$parameters=$tpl->javascript_parse_text("{parameters}");
	$delete=$tpl->javascript_parse_text("{delete}");
	$created=$tpl->javascript_parse_text("{created}");

	$buttons="
	buttons : [
	{name: '$new_connection', bclass: 'Add', onpress : NewCNx$t},
	
	],";
	
	$html="
	<div id='query-explain'></div>
	<table class='flexRT$t' style='display: none' id='flexRT$t' style='width:99%'></table>
	<script>
	var mem$t='';
	$(document).ready(function(){
	$('#flexRT$t').flexigrid({
	url: '$page?items=yes&t=$t',
	dataType: 'json',
	colModel : [
	{display: '$hostname', name : 'hostname', width :515, sortable : true, align: 'left'},
	{display: '$ttl', name : 'ttl', width :190, sortable : true, align: 'left'},
	{display: '$enabled', name : 'enabled', width :60, sortable : false, align: 'center'},
	{display: '&nbsp;', name : 'none', width :35, sortable : true, align: 'center'},
	],
	$buttons
	
	searchitems : [
	{display: '$hostname', name : 'hostname'},
	
	],
	sortname: 'hostname',
	sortorder: 'asc',
	usepager: true,
	title: '<span id=\"title-$t\">Active Directory</span>',
	useRp: true,
	rp: 50,
	showTableToggleBtn: false,
	width: '99%',
	height: 550,
	singleSelect: true,
	rpOptions: [10, 20, 30, 50,100,200,500]
	
	});
	});


	
	function NewCNx$t(){
		Loadjs('$page?popup-ad-js=yes&md5=&t=$t');
	}
</script>";
	
			echo $html;
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:75,代码来源:squid.webauth.activedirectory.php

示例5: buildconfig

function buildconfig()
{
    # $Id$";
    msg_html();
    $sock = new sockets();
    $unix = new unix();
    $q = new mysql_squid_builder();
    $q->check_hotspot_tables();
    $php = $unix->LOCATE_PHP5_BIN();
    $SquidHotSpotPort = intval($sock->GET_INFO("SquidHotSpotPort"));
    $ArticaHotSpotPort = intval($sock->GET_INFO("ArticaHotSpotPort"));
    $ArticaSSLHotSpotPort = intval($sock->GET_INFO("ArticaSSLHotSpotPort"));
    $ArticaSplashHotSpotPort = intval($sock->GET_INFO("ArticaSplashHotSpotPort"));
    $SquidHotSpotSSLPort = intval($sock->GET_INFO("SquidHotSpotSSLPort"));
    $HospotNoSSL = intval($sock->GET_INFO("HospotNoSSL"));
    $HotSpotDenySSL = intval($sock->GET_INFO("HotSpotDenySSL"));
    $ArticaHotSpotEmergency = intval($sock->GET_INFO("ArticaHotSpotEmergency"));
    $ArticaSplashHotSpotPortSSL = intval($sock->GET_INFO("ArticaSplashHotSpotPortSSL"));
    $ArticaSplashHotSpotCertificate = $sock->GET_INFO("ArticaSplashHotSpotCertificate");
    $ArticaHotSpotInterface = $sock->GET_INFO("ArticaHotSpotInterface");
    $ArticaHotSpotInterface2 = $sock->GET_INFO("ArticaHotSpotInterface2");
    if ($ArticaHotSpotInterface == null) {
        $ArticaHotSpotInterface = "eth0";
    }
    $ArticaHotSpotEnableMIT = $sock->GET_INFO("ArticaHotSpotEnableMIT");
    $ArticaHotSpotEnableProxy = $sock->GET_INFO("ArticaHotSpotEnableProxy");
    if (!is_numeric($ArticaHotSpotEnableMIT)) {
        $ArticaHotSpotEnableMIT = 1;
    }
    if (!is_numeric($ArticaHotSpotEnableProxy)) {
        $ArticaHotSpotEnableProxy = 1;
    }
    if ($ArticaHotSpotInterface2 == $ArticaHotSpotInterface) {
        $ArticaHotSpotInterface2 = null;
    }
    if ($ArticaSplashHotSpotPort == 0) {
        $ArticaSplashHotSpotPort = 16080;
    }
    if ($ArticaSplashHotSpotPortSSL == 0) {
        $ArticaSplashHotSpotPortSSL = 16443;
    }
    if ($ArticaHotSpotPort == 0) {
        $ArticaHotSpotPort = rand(38000, 64000);
        $sock->SET_INFO("ArticaHotSpotPort", $ArticaHotSpotPort);
    }
    if ($ArticaSSLHotSpotPort == 0) {
        $ArticaSSLHotSpotPort = rand(38500, 64000);
        $sock->SET_INFO("ArticaSSLHotSpotPort", $ArticaSSLHotSpotPort);
    }
    if ($SquidHotSpotPort == 0) {
        $SquidHotSpotPort = rand(40000, 64000);
        $sock->SET_INFO("SquidHotSpotPort", $SquidHotSpotPort);
    }
    if ($SquidHotSpotSSLPort == 0) {
        $SquidHotSpotSSLPort = rand(40500, 64000);
        $sock->SET_INFO("SquidHotSpotSSLPort", $SquidHotSpotSSLPort);
    }
    $NETWORK_ALL_INTERFACES = $unix->NETWORK_ALL_INTERFACES();
    $IPADDR = $NETWORK_ALL_INTERFACES[$ArticaHotSpotInterface]["IPADDR"];
    $GatewayAddress = $IPADDR;
    $sock->SET_INFO("HotSpotGatewayAddr", $IPADDR);
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}: HTTP service on {$NETWORK_ALL_INTERFACES[$ArticaHotSpotInterface]["IPADDR"]} `{$IPADDR}` port\n";
    }
    $HospotHTTPServerName = trim($sock->GET_INFO("HospotHTTPServerName"));
    $IPADDR2 = $NETWORK_ALL_INTERFACES[$ArticaHotSpotInterface2]["IPADDR"];
    $WifiDogDebugLevel = intval($sock->GET_INFO("WifiDogDebugLevel"));
    build_progress("{reconfiguring}", 60);
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}: HTTP service on {$ArticaSplashHotSpotPort} port\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}: HTTPS service on {$ArticaSplashHotSpotPortSSL} port\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}: HotSpot service on {$ArticaHotSpotPort} port\n";
    }
    if ($ArticaHotSpotInterface2 != null) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Configuring...: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}: Listen IN on {$ArticaHotSpotInterface} ( {$IPADDR} )\n";
        }
        if ($GLOBALS["OUTPUT"]) {
            echo "Configuring...: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}: Listen OUT on {$ArticaHotSpotInterface2} ( {$IPADDR2} )\n";
        }
    } else {
        if ($GLOBALS["OUTPUT"]) {
            echo "Configuring...: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}: Listen on {$ArticaHotSpotInterface} ( {$IPADDR} )\n";
        }
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}: Proxy Listen on {$SquidHotSpotPort} port\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}: Re-authenticate each {$ArticaSplashHotSpotCacheAuth} Minutes\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}: Debug Level:{$WifiDogDebugLevel}\n";
    }
    $Checking_squid = Checking_squid($SquidHotSpotPort);
    if (!$Checking_squid) {
//.........这里部分代码省略.........
开发者ID:articatech,项目名称:artica,代码行数:101,代码来源:exec.wifidog.php

示例6: table

function table()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $tt = time();
    $t = $_GET["t"];
    $_GET["ruleid"] = $_GET["ID"];
    $groups = $tpl->javascript_parse_text("{groups}");
    $from = $tpl->_ENGINE_parse_body("{from}");
    $to = $tpl->javascript_parse_text("{to}");
    $rule = $tpl->javascript_parse_text("{rule}");
    $delete = $tpl->javascript_parse_text("{delete} {zone} ?");
    $rewrite_rules_fdb_explain = $tpl->javascript_parse_text("{rewrite_rules_fdb_explain}");
    $new_network = $tpl->javascript_parse_text("{new_rule}");
    $comment = $tpl->javascript_parse_text("{comment}");
    $rules = $tpl->javascript_parse_text("{rules}");
    $rule = $tpl->javascript_parse_text("{rule}");
    $apply = $tpl->javascript_parse_text("{apply}");
    $action = $tpl->javascript_parse_text("{action}");
    $order = $tpl->javascript_parse_text("{order}");
    $networks = $tpl->javascript_parse_text("{networks}");
    $restricted = $tpl->javascript_parse_text("{restricted}");
    $type = $tpl->javascript_parse_text("{type}");
    $protocol = $tpl->javascript_parse_text("{protocol}");
    $port = $tpl->javascript_parse_text("{port}");
    $trusted_MAC = $tpl->javascript_parse_text("{trusted_MAC}");
    $trusted_sslwebsites = $tpl->javascript_parse_text("{trusted_ssl_sites}");
    $title = $networks;
    $tt = time();
    $q = new mysql_squid_builder();
    $q->check_hotspot_tables();
    $buttons = "\n\tbuttons : [\n\t{name: '<strong style=font-size:20px>{$new_network}</strong>', bclass: 'add', onpress : NewRule{$tt}},\n\t{name: '<strong style=font-size:20px>{$trusted_MAC}</strong>', bclass: 'Settings', onpress : rports},\n\t{name: '<strong style=font-size:20px>{$trusted_sslwebsites}</strong>', bclass: 'Settings', onpress : rssls},\n\t{name: '<strong style=font-size:20px>{$apply}</strong>', bclass: 'Reconf', onpress : Apply{$tt}},\n\t],";
    $html = "\n\t<table class='flexRT{$tt}' style='display: none' id='flexRT{$tt}' style='width:100%'></table>\n\t<script>\n\tfunction Start{$tt}(){\n\t\$('#flexRT{$tt}').flexigrid({\n\turl: '{$page}?items=yes&t={$tt}&tt={$tt}&t-rule={$_GET["t"]}&ruleid={$_GET["ruleid"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '<span style=font-size:22px>{$order}</span>', name : 'zorder', width :78, sortable : true, align: 'center'},\n\t{display: '<span style=font-size:22px>{$protocol}</span>', name : 'proto', width :138, sortable : true, align: 'center'},\n\t{display: '<span style=font-size:22px>{$networks}</span>', name : 'pattern', width :612, sortable : true, align: 'left'},\n\t{display: '<span style=font-size:22px>{$type}</span>', name : 'hotspoted', width :100, sortable : false, align: 'center'},\n\t{display: '<span style=font-size:22px>{$action}</span>', name : 'action', width :100, sortable : true, align: 'center'},\n\t{display: '<span style=font-size:22px>up</span>', name : 'up', width :81, sortable : false, align: 'center'},\n\t{display: '<span style=font-size:22px>down</span>', name : 'down', width :81, sortable : false, align: 'center'},\n\t{display: '&nbsp;', name : 'delete', width : 81, sortable : false, align: 'center'},\n\t],\n\t{$buttons}\n\tsearchitems : [\n\t{display: '{$networks}', name : 'pattern'},\n\t{display: '{$port}', name : 'port'},\n\t],\n\tsortname: 'zorder',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '<span style=font-size:30px>{$title}</span>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 450,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\n});\n}\n\nvar xNewRule{$tt}= function (obj) {\n\tvar res=obj.responseText;\n\tif (res.length>3){alert(res);return;}\n\t\$('#flexRT{$t}').flexReload();\n\t\$('#flexRT{$tt}').flexReload();\n}\n\nfunction Apply{$tt}(){\n\tLoadjs('squid.webauth.restart.php');\n}\n\n\nfunction NewRule{$tt}(){\n\tLoadjs('{$page}?item-js=yes&ID=0&t={$tt}',true);\n}\nfunction Delete{$tt}(zmd5){\n\tif(confirm('{$delete}')){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('policy-delete', zmd5);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xNewRule{$tt});\n\t}\n}\n\nvar xINOUT{$tt}= function (obj) {\n\tvar res=obj.responseText;\n\tif (res.length>3){alert(res);return;}\n\t\$('#flexRT{$t}').flexReload();\n\t\$('#flexRT{$tt}').flexReload();\n}\n\n\nfunction INOUT{$tt}(ID){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('INOUT', ID);\n\tXHR.sendAndLoad('{$page}', 'POST',xINOUT{$tt});\n}\n\nfunction rports(){\n\tLoadjs('squid.webauth.hotspots.allowed.macs.php',true);\n}\n\nfunction rssls(){\n\tLoadjs('squid.webauth.hotspots.ssl.objects.php',true);\n}\n\nfunction reverse{$tt}(ID){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('reverse', ID);\n\tXHR.sendAndLoad('{$page}', 'POST',xINOUT{$tt});\n}\n\nvar x_LinkAclRuleGpid{$tt}= function (obj) {\nvar res=obj.responseText;\nif(res.length>3){alert(res);return;}\n\$('#table-{$t}').flexReload();\n\$('#flexRT{$tt}').flexReload();\nExecuteByClassName('SearchFunction');\n}\nfunction FlexReloadRulesRewrite(){\n\$('#flexRT{$t}').flexReload();\n}\n\nfunction MoveRuleDestination{$tt}(mkey,direction){\nvar XHR = new XHRConnection();\nXHR.appendData('rules-destination-move', mkey);\nXHR.appendData('direction', direction);\nXHR.sendAndLoad('{$page}', 'POST',x_LinkAclRuleGpid{$tt});\n}\n\nfunction MoveRuleDestinationAsk{$tt}(mkey,def){\nvar zorder=prompt('Order',def);\nif(!zorder){return;}\nvar XHR = new XHRConnection();\nXHR.appendData('rules-destination-move', mkey);\nXHR.appendData('rules-destination-zorder', zorder);\nXHR.sendAndLoad('{$page}', 'POST',x_LinkAclRuleGpid{$tt});\n}\nStart{$tt}();\n\n</script>\n";
    echo $html;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:35,代码来源:squid.webauth.hotspots.php


注:本文中的mysql_squid_builder::check_hotspot_tables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。