Ejemplo n.º 1
0
$wan_lowerlayer = "";
$russia_ppp = 0;
$i = 1;
while ($i > 0 && $i < 4) {
    $ifname = "WAN-" . $i;
    $ifpath = XNODE_getpathbytarget("runtime", "inf", "uid", $ifname, 0);
    $ifpath2 = XNODE_getpathbytarget("", "inf", "uid", $ifname, 0);
    if ($ifpath == "") {
        $i++;
        continue;
    }
    $inet_addrtype = query($ifpath . "/inet/addrtype");
    $lowerlayer = query($ifpath2 . "/lowerlayer");
    if ($lowerlayer != "") {
        $wan_lowerlayer = $lowerlayer;
        if (get("", INF_getinfpath($wan_lowerlayer) . "/active") == "1" && get("", INF_getinfpath($wan_lowerlayer) . "/nat") == "NAT-1") {
            $russia_ppp = 1;
        }
    }
    $str = "";
    if ($wan_lowerlayer == $ifname) {
        $str = "Physical";
    }
    //for normal PPP mode, we skip the physical interface, since we don't do NAT in this physical interface.
    //if want to set routing to this interface, then we should do NAT in this physical.
    //if($ifname == $wan_lowerlayer) { $i++; continue; }
    if ($inet_addrtype == "ipv4" && $wan_lowerlayer == "") {
        $ip = query($ifpath . "/inet/ipv4/ipaddr");
        $show_ifname = "WAN " . $str . " (" . $ip . ")";
    } else {
        if ($inet_addrtype == "ipv4" && $russia_ppp == 1) {
Ejemplo n.º 2
0
?>
				XS(b+"/description",	OBJ("dsc_"+i).value);
				XS(b+"/internal/inf",	"LAN-1");
				if (OBJ("ip_"+i).value == "") XS(b+"/internal/hostid", "");
				else XS(b+"/internal/hostid",COMM_IPv4HOST(OBJ("ip_"+i).value, this.mask));
				XS(b+"/tport_str",	OBJ("port_tcp_"+i).value);
				XS(b+"/uport_str",	OBJ("port_udp_"+i).value);
			}
			
			//Check the port confliction between STORAGE, VSVR, PFWD and REMOTE.
			var admin_remote_port = "<?php 
echo query(INF_getinfpath("WAN-1") . "/web");
?>
";
			var admin_remote_port_https = "<?php 
echo query(INF_getinfpath("WAN-1") . "/https_rport");
?>
";
			if(PortStringCheck(OBJ("port_tcp_"+i).value, admin_remote_port) || 
				PortStringCheck(OBJ("port_tcp_"+i).value, admin_remote_port_https))
			{
				BODY.ShowAlert("<?php 
echo i18n("The input TCP port could not be the same as the remote admin port in the administration function.");
?>
");
				OBJ("port_tcp_"+i).focus();
				return null;			
			}
			var webaccess_remote_en = <?php 
if (query("/webaccess/enable") == 1 && query("/webaccess/remoteenable") == 1) {
    echo "true";
Ejemplo n.º 3
0
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8

<?php 
echo "\\<\\?xml version='1.0' encoding='utf-8'\\?\\>";
include "/htdocs/phplib/xnode.php";
include "/htdocs/phplib/inf.php";
include "/htdocs/webinc/config.php";
$WAN1_INF = INF_getinfpath($WAN1);
if (query($WAN1_INF . "/open_dns/type") == "") {
    $EnableOpenDNS = false;
} else {
    $EnableOpenDNS = true;
}
$DeviceID = query($WAN1_INF . "/open_dns/deviceid");
if (query($WAN1_INF . "/open_dns/type") == "parent") {
    $OpenDNSMode = "Parental";
} else {
    if (query($WAN1_INF . "/open_dns/type") == "family") {
        $OpenDNSMode = "FamilyShield";
    } else {
        $OpenDNSMode = "Advanced";
    }
}
$OpenDNSMode = query($WAN1_INF . "/open_dns/type");
$DeviceKey = query($WAN1_INF . "/open_dns/nonce");
?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	<soap:Body>
		<GetOpenDNSResponse xmlns="http://purenetworks.com/HNAP1/">
			<GetOpenDNSResult>OK</GetOpenDNSResult>
Ejemplo n.º 4
0
        $Response = "BindTimeout";
    }
}
if ($Response == "BindSuccess") {
    set(INF_getinfpath($WAN1) . "/open_dns/type", "parent");
    set(INF_getinfpath($WAN1) . "/open_dns/deviceid", $_GET["deviceid"]);
    set(INF_getinfpath($WAN1) . "/open_dns/parent_dns_srv/dns1", $_GET["dnsip1"]);
    set(INF_getinfpath($WAN1) . "/open_dns/parent_dns_srv/dns2", $_GET["dnsip2"]);
    //+++sam_pan add
    $LAN1 = "LAN-1";
    $dns4 = INF_getinfpath($LAN1) . "/dns4";
    set($dns4, "DNS4-1");
    event("DBSAVE");
    //---sam_pan
    setattr(INF_getinfpath($WAN1) . "/open_dns/service", "set", "service OPENDNS4.MAP restart");
    set(INF_getinfpath($WAN1) . "/open_dns/service", "");
}
?>
<html>
	<head>
		<meta http-equiv="Pragma" content="no-cache"> <!--for HTTP 1.1-->
		<meta http-equiv="Cache-Control" content="no-cache"> <!--for HTTP 1.0--> 
		<meta http-equiv="Expires" content="0"> <!--prevents caching at the proxy server-->
		<meta name="Description" content="<?php 
echo $Response;
?>
"/>
		<script type="text/javascript">
			var Response = "<?php 
echo $Response;
?>