示例#1
0
function php_getinstanceids($str)
{
    if ("Enabled" == $_SESSION["psmMode"]) {
        if (strstr($str, "WiFi")) {
            return "";
        }
        if (strstr($str, "MoCA")) {
            return "";
        }
    }
    return getInstanceIds($str);
}
示例#2
0
function get_tips($target, $status)
{
    $tip = "No Tips!";
    switch ($target) {
        case "sta_inet":
            if ("true" == $status) {
                $tip = 'Status: Connected<br/>' . getStr("Device.Hosts.X_CISCO_COM_ConnectedDeviceNumber") . ' computers connected';
            } else {
                $tip = 'Status: Unconnected<br/>no computers';
            }
            break;
        case "sta_wifi":
            if ("true" == $status) {
                $sum = 0;
                $ids = explode(",", getInstanceIds("Device.WiFi.AccessPoint."));
                foreach ($ids as $i) {
                    $sum += getStr("Device.WiFi.AccessPoint.{$i}.AssociatedDeviceNumberOfEntries");
                }
                $tip = 'Status: Connected<br/>' . $sum . ' computers connected';
            } else {
                $tip = 'Status: Unconnected<br/>no computers';
            }
            break;
        case "sta_moca":
            if ("true" == $status && "Up" == getStr("Device.MoCA.Interface.1.Status")) {
                $tip = 'Status: Connected<br/>' . (1 + intval(getStr("Device.MoCA.Interface.1.AssociatedDeviceNumberOfEntries"))) . ' nodes connected';
            } else {
                $tip = 'Status: Unconnected<br/>no nodes';
            }
            break;
        case "sta_dect":
            if ("true" == $status) {
                $tip = getStr("Device.X_CISCO_COM_MTA.Dect.HandsetsNumberOfEntries") . ' Handsets connected';
            } else {
                $tip = 'no Handsets';
            }
            break;
        case "sta_fire":
            $tip = 'Firewall is set to ' . $status;
            break;
        default:
            $tip = "No Tips!";
            break;
    }
    return $tip;
}
示例#3
0
/**
 *  Description: Judge whether the user input ip valid or not (based on current gw ip and subnetmask)
 *  parameter  : input IP address
 *  return     : bool(TRUE/FALSE)
 */
function isIPValid($IP)
{
    $ret = TRUE;
    $LanSubMask = getStr("Device.X_CISCO_COM_DeviceControl.LanManagementEntry.1.LanSubnetMask");
    $LanGwIP = getStr("Device.X_CISCO_COM_DeviceControl.LanManagementEntry.1.LanIPAddress");
    $gwIP = explode('.', $LanGwIP);
    $hostIP = explode('.', $IP);
    if ($LanGwIP == $IP) {
        $ret = FALSE;
    } elseif (strstr($IP, '172.16.12')) {
        //$msg = "This ip is reserved for home security";
        $ret = FALSE;
    } elseif (strstr($LanSubMask, '255.255.255')) {
        //the first three field should be equal to gw ip field
        if ($gwIP[0] != $hostIP[0] || $gwIP[1] != $hostIP[1] || $gwIP[2] != $hostIP[2]) {
            //$msg = "Input IP is not in valid range:\n" . "$gwIP[0].$gwIP[1].$gwIP[2].[2~254]";
            $ret = FALSE;
        }
    } elseif ($LanSubMask == '255.255.0.0') {
        if ($gwIP[0] != $hostIP[0] || $gwIP[1] != $hostIP[1]) {
            //$msg = "Input IP is not in valid range:\n" . "$gwIP[0].$gwIP[1].[2~254].[2~254]";
            $ret = FALSE;
        }
    } else {
        if ($gwIP[0] != $hostIP[0]) {
            //$msg = "Input IP is not in valid range:\n [10.0.0.2 ~ 10.255.255.254]";
            $ret = FALSE;
        }
    }
    if ($ret) {
        //if above check pass, then check whether the IP have been used or not
        $idArr = explode(",", getInstanceIds("Device.DHCPv4.Server.Pool.1.StaticAddress."));
        foreach ($idArr as $key => $value) {
            if (!strcasecmp(getStr("Device.DHCPv4.Server.Pool.1.StaticAddress.{$value}.Yiaddr"), $IP)) {
                $ret = FALSE;
                break;
            }
        }
    }
    return $ret;
}
示例#4
0
文件: qos.php 项目: WizzerWorks/webui
        <input id="clear_callsignallog"  type="submit" onClick="save_config('clear_callsignallog')"   value="Clear" class="btn" />
    </div>
	
	<div class="module data">
		<h2>QoS </h2>
		<table class="data">
			<tr>
				<th>SFID</th>
				<th>Service Class Name</th>
				<th>Direction</th>
				<th>Primary Flow</th>
				<th>Traffic Type</th>
				<th>Packets</th>
			</tr>
			<?php 
$ids = array_filter(explode(",", getInstanceIds("Device.X_CISCO_COM_MTA.ServiceFlow.")));
$odd = true;
foreach ($ids as $id) {
    echo '<tr class="' . (($odd = !$odd) ? 'odd' : '') . '" >';
    echo '<td>' . getStr("Device.X_CISCO_COM_MTA.ServiceFlow.{$id}.SFID") . '</td>';
    echo '<td>' . getStr("Device.X_CISCO_COM_MTA.ServiceFlow.{$id}.ServiceClass") . '</td>';
    echo '<td>' . getStr("Device.X_CISCO_COM_MTA.ServiceFlow.{$id}.Direction") . '</td>';
    echo '<td>' . getStr("Device.X_CISCO_COM_MTA.ServiceFlow.{$id}.DefaultFlow") . '</td>';
    echo '<td>' . getStr("Device.X_CISCO_COM_MTA.ServiceFlow.{$id}.TrafficType") . '</td>';
    echo '<td>' . getStr("Device.X_CISCO_COM_MTA.ServiceFlow.{$id}.NumberOfPackets") . '</td>';
    echo '</tr>';
}
?>
		</table>
    </div> <!-- end .module -->
示例#5
0
	
		<form action="managed_services.php" method="post">
			<input  type="hidden"  name="update_trusted_computers"  value="true" />

		<?php 
$TrustedUserInstance = getInstanceIds("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser.");
$TrustedUserInstanceArr = explode(",", $TrustedUserInstance);
$TrustedUserNums = getStr("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUserNumberOfEntries");
$TrustedUser = array();
for ($i = 0; $i < $TrustedUserNums; $i++) {
    //$TrustedUser["$i"]['instanceID'] = $TrustedUserInstanceArr["$i"];
    $TrustedUser["{$i}"]['IPAddress'] = getStr("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser." . $TrustedUserInstanceArr["{$i}"] . ".IPAddress");
    $TrustedUser["{$i}"]['Trusted'] = getStr("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser." . $TrustedUserInstanceArr["{$i}"] . ".Trusted");
}
$hostsInstance = getInstanceIds("Device.Hosts.Host.");
$hostsInstanceArr = explode(",", $hostsInstance);
$hostNums = getStr("Device.Hosts.HostNumberOfEntries");
$ipAddrArr = array();
$HostNameArr = array();
for ($i = 0; $i < $hostNums; $i++) {
    $HostName = getStr("Device.Hosts.Host." . $hostsInstanceArr["{$i}"] . ".HostName");
    if ($HostName == "*" || strlen($HostName) == 0) {
        $Host["{$i}"]['HostName'] = getStr("Device.Hosts.Host." . $hostsInstanceArr["{$i}"] . ".PhysAddress");
    } else {
        $Host["{$i}"]['HostName'] = $HostName;
    }
    $Host["{$i}"]['IPAddress'] = getStr("Device.Hosts.Host." . $hostsInstanceArr["{$i}"] . ".IPAddress");
    array_push($HostNameArr, $Host["{$i}"]['HostName']);
    array_push($ipAddrArr, $Host["{$i}"]['IPAddress']);
    $Host["{$i}"]['Trusted'] = false;
include 'includes/userbar.php';
?>
</div><!-- end #sub-header -->

<?php 
include 'includes/nav.php';
$LanGwIP = getStr("Device.X_CISCO_COM_DeviceControl.LanManagementEntry.1.LanIPAddress");
$DHCPTime = getStr("Device.DHCPv4.Server.Pool.1.LeaseTime");
$DHCPV6Time = getStr("Device.DHCPv6.Server.Pool.1.LeaseTime");
$ipv6_prefix = getStr("Device.IP.Interface.1.IPv6Prefix.1.Prefix");
$interface = getStr("com.cisco.spvtg.ccsp.pam.Helper.FirstDownstreamIpInterface");
// $interface = "Device.IP.Interface.2.";
// initial some variable to suppress some error
$ipv6_local_addr = "";
$ipv6_global_addr = "";
$idArr = explode(",", getInstanceIds($interface . "IPv6Address."));
foreach ($idArr as $key => $value) {
    $ipv6addr = getStr($interface . "IPv6Address.{$value}.IPAddress");
    if (stripos($ipv6addr, "fe80::") !== false) {
        $ipv6_local_addr = $ipv6addr;
    } else {
        $ipv6_global_addr = $ipv6addr;
    }
}
//$ipv6_local_addr = "fe80::20c:29ff:fe43:aac4/64";
//$ipv6_global_addr= "2002:48a3::48a3:ff63";
$tmp = substr($ipv6_local_addr, 6);
//remove fe80::
$tmp1 = explode('/', $tmp);
//trim /64
$local_ipv6 = $tmp1[0];
示例#7
0
$(document).ready(function() {
    comcast.page.init("Gateway > Connection > QoS", "nav-qos");
});

</script>


<div id="content">
	<h1>Gateway > Connection > QoS > DSX logs</h1>
	<div class="module forms data" id="event">
	<?php 
function del_blank($v)
{
    return "" == $v ? false : true;
}
$ids = array_filter(explode(",", getInstanceIds("Device.X_CISCO_COM_MTA.DSXLog.")));
if (1 == count($ids)) {
    echo '<h3 id="log_summary">There are currently no DSX Logs</h3>';
} else {
    echo '<h2>MTA SIP Packet Log</h2><table class="data" summary="This table shows DSX logs"><thead><tr><th id="dsx_metrics">Metrics</th><th id="dsx_ds">Downstream</th><th id="dsx_us">Upstream</th></tr></thead>';
    for ($i = 1; $i < count($ids); $i++) {
        $item = array_values(array_filter(explode(" ", getStr("Device.X_CISCO_COM_MTA.DSXLog.{$ids[$i]}.Description")), "del_blank"));
        echo '<tr class="' . ($i % 2 ? 'odd' : '') . '" >';
        echo '<td headers="dsx_metrics">' . $item[0] . ' ' . $item[1] . '</td>';
        echo '<td headers="dsx_ds">' . $item[2] . '</td>';
        echo '<td headers="dsx_us">' . $item[3] . '</td>';
        echo '</tr>';
    }
    echo '<tfoot><tr class="acs-hide"><td headers="dsx_metrics">null</td><td headers="dsx_ds">null</td><td headers="dsx_us">null</td></tr></tfoot>';
    echo '</table>';
}
            setStr("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser.{$value}.Trusted", $flag['trustFlag'], true);
            break;
        }
    }
    if (!$deviceExist) {
        addTblObj("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser.");
        $IDs = getInstanceIds("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser.");
        $idArr = explode(",", $IDs);
        $instanceid = array_pop($idArr);
        setStr("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser.{$instanceid}.HostDescription", $flag['HostName'], false);
        setStr("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser.{$instanceid}.IPAddress", $flag['IPAddress'], false);
        if (strpbrk($flag['IPAddress'], ':') != FALSE) {
            setStr("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser.{$instanceid}.IPAddressType", "IPv6", false);
        } else {
            setStr("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser.{$instanceid}.IPAddressType", "IPv4", false);
        }
        setStr("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser.{$instanceid}.Trusted", $flag['trustFlag'], true);
    }
} else {
    // "yes" => "no" not trusted
    $IDs = getInstanceIds("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser.");
    $idArr = explode(",", $IDs);
    foreach ($idArr as $key => $value) {
        if ($flag['IPAddress'] == getStr("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser.{$value}.IPAddress")) {
            $index = $value;
            break;
        }
    }
    setStr("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser.{$index}.Trusted", 'false', true);
    //delTblObj("Device.X_Comcast_com_ParentalControl.ManagedServices.TrustedUser.$index.");
}
示例#9
0
$jsConfig = json_encode($arConfig);
*/
/************************************!!!Backend Design Changed!!!**********************************************/
$online_client = array();
$disconnect_client = array_trim(explode(",", getStr("Device.MoCA.X_CISCO_COM_WiFi_Extender.X_CISCO_COM_DISCONNECT_CLIENT")));
// get all wired attached MoCA extender (including connected/disconnected(just disable radio))
$dat = array();
$exts = explode(",", getInstanceIds("Device.MoCA.X_CISCO_COM_WiFi_Extender.ExtenderDevice."));
// $exts	= explode(",", "");
$exts = array_trim($exts);
foreach ($exts as $i) {
    $dat[$i]['ext_name'] = getStr("Device.MoCA.X_CISCO_COM_WiFi_Extender.ExtenderDevice.{$i}.DeviceName");
    $dat[$i]['ext_ip'] = trim(getStr("Device.MoCA.X_CISCO_COM_WiFi_Extender.ExtenderDevice.{$i}.IPAddress"));
    $dat[$i]['ext_action'] = in_array($dat[$i]['ext_ip'], $disconnect_client) ? "Connect" : "Disconnect";
    $dat[$i]['ssid_info'] = array();
    $ssids = explode(",", getInstanceIds("Device.MoCA.X_CISCO_COM_WiFi_Extender.ExtenderDevice.{$i}.SSID."));
    foreach ($ssids as $j) {
        array_push($dat[$i]['ssid_info'], array('ssid' => getStr("Device.MoCA.X_CISCO_COM_WiFi_Extender.ExtenderDevice.{$i}.SSID.{$j}.SSID"), 'bssid' => getStr("Device.MoCA.X_CISCO_COM_WiFi_Extender.ExtenderDevice.{$i}.SSID.{$j}.BSSID"), 'freq' => getStr("Device.MoCA.X_CISCO_COM_WiFi_Extender.ExtenderDevice.{$i}.SSID.{$j}.Band"), 'channel' => getStr("Device.MoCA.X_CISCO_COM_WiFi_Extender.ExtenderDevice.{$i}.SSID.{$j}.Channel"), 'secur' => encrypt_map(getStr("Device.MoCA.X_CISCO_COM_WiFi_Extender.ExtenderDevice.{$i}.SSID.{$j}.SecurityMode"), getStr("Device.MoCA.X_CISCO_COM_WiFi_Extender.ExtenderDevice.{$i}.SSID.{$j}.Encryption"))));
    }
    array_push($online_client, $dat[$i]['ext_ip']);
}
$arConfig = array('dat' => $dat, 'online_client' => $online_client, 'disconnect_client' => $disconnect_client);
$jsConfig = json_encode($arConfig);
?>

<style>
#range_extender td
  {
  border: 1px solid #39BAF1;
  }
         }
     }
     if ($del_mac) {
         //if an old mac is not in new table, then delete it from old table
         delTblObj("Device.WiFi.AccessPoint.{$i}.X_CISCO_COM_MacFilterTable.{$j}.");
     } else {
         //or delete the mac from new table, and resort new table(key as 0, 1, 2...)
         array_splice($ft, $k, 1);
     }
 }
 //add enough new instance, but we can't tell which ID is added!!!
 for ($j = 0; $j < count($ft); $j++) {
     addTblObj("Device.WiFi.AccessPoint.{$i}.X_CISCO_COM_MacFilterTable.");
 }
 //get all instance IDs, perhaps contains old IDs
 $new_id = array_filter(explode(",", getInstanceIds("Device.WiFi.AccessPoint.{$i}.X_CISCO_COM_MacFilterTable.")));
 //find the IDs in new table, but not in old table
 $id = array_diff($new_id, $old_id);
 //key the diff array as 0, 1, 2...
 sort($id);
 //add the rest
 if (count($id) > 0) {
     for ($j = 0; $j < count($ft); $j++) {
         setStr("Device.WiFi.AccessPoint.{$i}.X_CISCO_COM_MacFilterTable.{$id[$j]}.DeviceName", $ft[$j][0], false);
         setStr("Device.WiFi.AccessPoint.{$i}.X_CISCO_COM_MacFilterTable.{$id[$j]}.MACAddress", $ft[$j][1], true);
     }
 }
 //MAC filter mode, else is "allow_all"
 if ("allow" == $arConfig['filtering_mode']) {
     $filter_enable = "true";
     $filter_block = "false";
        echo "0";
    } else {
        echo "1";
    }
} else {
    //this is to set blocked Keyword
    $keyword = $blockedSiteInfo['Keyword'];
    foreach ($idArr as $key => $value) {
        if ($keyword == getStr($objPrefix . $value . ".Site")) {
            $exist = true;
            break;
        }
    }
    if (!$exist) {
        addTblObj("Device.X_Comcast_com_ParentalControl.ManagedSites.BlockedSite.");
        $idArr = explode(",", getInstanceIds("Device.X_Comcast_com_ParentalControl.ManagedSites.BlockedSite."));
        $index = array_pop($idArr);
        if ($blockedSiteInfo['alwaysBlock'] == 'true') {
            $paramArray = array(array($objPrefix . $index . ".Site", "string", $blockedSiteInfo['Keyword']), array($objPrefix . $index . ".AlwaysBlock", "bool", $blockedSiteInfo['alwaysBlock']), array($objPrefix . $index . ".BlockMethod", "string", "Keyword"));
            $retStatus = DmExtSetStrsWithRootObj($rootObjName, TRUE, $paramArray);
            if (!$retStatus) {
                $result = "Success!";
            } else {
                $result = 'Failed to add';
            }
            /*setStr($objPrefix.$index.".Site", $blockedSiteInfo['Keyword'], false);
            		setStr($objPrefix.$index.".AlwaysBlock", $blockedSiteInfo['alwaysBlock'], false);
            		setStr($objPrefix.$index.".BlockMethod", "Keyword", true);*/
        } else {
            $paramArray = array(array($objPrefix . $index . ".Site", "string", $blockedSiteInfo['Keyword']), array($objPrefix . $index . ".AlwaysBlock", "bool", $blockedSiteInfo['alwaysBlock']), array($objPrefix . $index . ".BlockMethod", "string", "Keyword"), array($objPrefix . $index . ".StartTime", "string", $blockedSiteInfo['StartTime']), array($objPrefix . $index . ".EndTime", "string", $blockedSiteInfo['EndTime']), array($objPrefix . $index . ".BlockDays", "string", $blockedSiteInfo['blockedDays']));
            $retStatus = DmExtSetStrsWithRootObj($rootObjName, TRUE, $paramArray);
示例#12
0
?>
<!-- $Id: cordless_handsets.php 3158 2010-01-08 23:32:05Z slemoine $ -->

<div id="sub-header">
	<?php 
include 'includes/userbar.php';
?>
</div><!-- end #sub-header -->

<?php 
include 'includes/nav.php';
?>

<?php 
$dat = array();
$ids = array_trim(explode(",", getInstanceIds("Device.X_CISCO_COM_MTA.Dect.Handsets.")));
foreach ($ids as $i) {
    array_push($dat, array('hs_id' => $i, 'hs_name' => getStr("Device.X_CISCO_COM_MTA.Dect.Handsets.{$i}.HandsetName"), 'hs_otn' => getStr("Device.X_CISCO_COM_MTA.Dect.Handsets.{$i}.OperatingTN"), 'hs_stn' => getStr("Device.X_CISCO_COM_MTA.Dect.Handsets.{$i}.SupportedTN"), 'hs_time' => getStr("Device.X_CISCO_COM_MTA.Dect.Handsets.{$i}.LastActiveTime"), 'hs_stat' => getStr("Device.X_CISCO_COM_MTA.Dect.Handsets.{$i}.Status")));
}
$cat_iq = getStr("Device.X_CISCO_COM_MTA.Dect.Enable");
$cat_pin = getStr("Device.X_CISCO_COM_MTA.Dect.PIN");
$jsConfig = json_encode($dat);
?>

<style>
#tn_div label {
	text-align: left;
	font-style: bold;
}
#tn_div span {
	margin: 0 96px;
示例#13
0
文件: lan.php 项目: WizzerWorks/webui
	<?php 
function NameMap($str)
{
    switch ($str) {
        case "Up":
            return "Active";
            break;
        case "Down":
            return "Inactive";
            break;
        default:
            return $str;
    }
}
$ids = array_filter(explode(",", getInstanceIds("Device.Ethernet.Interface.")));
if ($_DEBUG) {
    $ids = array("1", "2", "3", "4");
}
foreach ($ids as $id) {
    if ("true" == getStr("Device.Ethernet.Interface.{$id}.Upstream")) {
        continue;
    }
    echo '<div class="module forms block">';
    echo '<h2>LAN Ethernet Port ' . $id . '</h2>';
    $dm = array(array("LAN Ethernet link status:", null, "Device.Ethernet.Interface.{$id}.Status"), array("MAC Address:", null, "Device.Ethernet.Interface.{$id}.MACAddress"));
    /* link speed */
    $lspeed = getStr("Device.Ethernet.Interface.{$id}.MaxBitRate");
    $lunit = " Mbps";
    if (empty($lspeed)) {
        $lspeed = "Not Applicable";
示例#14
0
<?php

$jsConfig = $_REQUEST['configInfo'];
//$jsConfig = '	{"dest":"Edit", "idex":"1", "name":"tom", "pass":"11111111"}';
$arConfig = json_decode($jsConfig, true);
//print_r($arConfig);
$id = $arConfig['idex'];
if ("Edit" == $arConfig['dest']) {
    setStr("Device.X_CISCO_COM_FileSharing.User.{$id}.UserName", $arConfig['name'], false);
    setStr("Device.X_CISCO_COM_FileSharing.User.{$id}.Password", $arConfig['pass'], true);
} else {
    if ("Add" == $arConfig['dest']) {
        addTblObj("Device.X_CISCO_COM_FileSharing.User.");
        $ids = array_filter(explode(",", getInstanceIds("Device.X_CISCO_COM_FileSharing.User.")));
        $id = $ids[count($ids) - 1];
        setStr("Device.X_CISCO_COM_FileSharing.User.{$id}.UserName", $arConfig['name'], false);
        setStr("Device.X_CISCO_COM_FileSharing.User.{$id}.Password", $arConfig['pass'], true);
    } else {
        if ("Delete" == $arConfig['dest']) {
            delTblObj("Device.X_CISCO_COM_FileSharing.User.{$id}.");
        }
    }
}
sleep(6);
echo $jsConfig;
示例#15
0
文件: usb.php 项目: WizzerWorks/webui
<script type="text/javascript">
$(document).ready(function() {
    comcast.page.init("Gateway > Hardware > USB", "nav-usb");
});
</script>

<div id="content">
	<h1>Gateway > Hardware > USB</h1>

	<div id="educational-tip">
		<p class="tip">View information about connected USB devices.</p>
	</div>

	<?php 
$ids = array_filter(explode(",", getInstanceIds("Device.USB.USBHosts.Host.1.Device.")));
// print_r($ids);
foreach ($ids as $id) {
    $dm = array(array("Status:", "", "Active"), array("Description:", "Device.USB.USBHosts.Host.1.Device.{$id}.ProductClass", ""), array("Serial Number:", "Device.USB.USBHosts.Host.1.Device.{$id}.SerialNumber", ""), array("Speed:", "Device.USB.USBHosts.Host.1.Device.{$id}.Rate", " Mbps"), array("Manufacturer:", "Device.USB.USBHosts.Host.1.Device.{$id}.Manufacturer", ""));
    echo '<div class="module forms block">';
    echo '<h2>USB Port ' . $id . '</h2>';
    for ($m = 0, $i = 0; $i < count($dm); $i++) {
        echo '<div class="form-row ' . ($m++ % 2 ? 'odd' : '') . '" >';
        echo '<span class="readonlyLabel">' . $dm[$i][0] . '</span>';
        echo '<span class="value">' . getStr($dm[$i][1]) . $dm[$i][2] . '</span>';
        echo '</div>';
    }
    echo '</div>';
}
?>
	
示例#16
0
echo getStr("Device.X_CISCO_COM_CableModem.Battery.RemainingCharge");
?>
");
	var b = parseInt("<?php 
echo getStr("Device.X_CISCO_COM_CableModem.Battery.ActualCapacity");
?>
");
	var sta_batt = (a<=b && a && b) ? Math.round(100*a/b) : 0;
	var sta_inet = "<?php 
echo "OPERATIONAL" == getStr("Device.X_CISCO_COM_CableModem.CMStatus") ? "true" : "false";
?>
";
	<?php 
$sta_wifi = "false";
if ("Disabled" == $_SESSION["psmMode"]) {
    $ssids = explode(",", getInstanceIds("Device.WiFi.SSID."));
    foreach ($ssids as $i) {
        $r = 2 - intval($i) % 2;
        //1,3,5,7==1(2.4G); 2,4,6,8==2(5G)
        if ("true" == getStr("Device.WiFi.Radio.{$r}.Enable") && "true" == getStr("Device.WiFi.SSID.{$i}.Enable")) {
            //bwg has radio.enable, active status is “at least one SSID and its Radio is enabled”
            $sta_wifi = "true";
            break;
        }
    }
}
?>
	var sta_wifi = "<?php 
echo $sta_wifi;
?>
";
        setStr("Device.X_Comcast_com_ParentalControl.ManagedDevices.Device." . $instanceid . ".MACAddress", $devBlockInfo['macAddr'], false);
        setStr("Device.X_Comcast_com_ParentalControl.ManagedDevices.Device." . $instanceid . ".AlwaysBlock", "true", true);
    }
    /*
     * if managed device is disabled, enable it
     */
    $enableFlag = getStr("Device.X_Comcast_com_ParentalControl.ManagedDevices.Enable");
    if (!strcasecmp($enableFlag, "false")) {
        setStr("Device.X_Comcast_com_ParentalControl.ManagedDevices.Enable", "true", true);
    }
    setStr("Device.X_Comcast_com_ParentalControl.ManagedDevices.AllowAll", "true", true);
} else {
    //this is going to set add XfinitySSID connected device to MAC filter list
    //wi-fi ssie 5 and 6 mapped to XfinitySSID
    setStr("Device.WiFi.AccessPoint.5.X_CISCO_COM_MACFilter.Enable", 'true', true);
    setStr("Device.WiFi.AccessPoint.5.X_CISCO_COM_MACFilter.FilterAsBlackList", 'true', true);
    addTblObj("Device.WiFi.AccessPoint.5.X_CISCO_COM_MacFilterTable.");
    $idArr = explode(",", getInstanceIds("Device.WiFi.AccessPoint.5.X_CISCO_COM_MacFilterTable."));
    $id = array_pop($idArr);
    setStr("Device.WiFi.AccessPoint.5.X_CISCO_COM_MacFilterTable.{$id}.DeviceName", $devBlockInfo['hostName'], false);
    setStr("Device.WiFi.AccessPoint.5.X_CISCO_COM_MacFilterTable.{$id}.MACAddress", $devBlockInfo['macAddr'], true);
    setStr("Device.WiFi.AccessPoint.6.X_CISCO_COM_MACFilter.Enable", 'true', true);
    setStr("Device.WiFi.AccessPoint.6.X_CISCO_COM_MACFilter.FilterAsBlackList", 'true', true);
    addTblObj("Device.WiFi.AccessPoint.6.X_CISCO_COM_MacFilterTable.");
    $idArr = explode(",", getInstanceIds("Device.WiFi.AccessPoint.6.X_CISCO_COM_MacFilterTable."));
    $id = array_pop($idArr);
    setStr("Device.WiFi.AccessPoint.6.X_CISCO_COM_MacFilterTable.{$id}.DeviceName", $devBlockInfo['hostName'], false);
    setStr("Device.WiFi.AccessPoint.6.X_CISCO_COM_MacFilterTable.{$id}.MACAddress", $devBlockInfo['macAddr'], true);
    //For WECB
    setStr("Device.MoCA.X_CISCO_COM_WiFi_Extender.X_CISCO_COM_SSID_Updated", "true", true);
}
示例#18
0
$ipv6_local_addr = "";
$ipv6_global_addr = "";
$ipv6_DNS = "";
$DNSv6Index = "";
/*local ipv6 address */
$idArr = explode(",", getInstanceIds($interface . "IPv6Address."));
foreach ($idArr as $key => $value) {
    $ipv6addr = getStr($interface . "IPv6Address.{$value}.IPAddress");
    if (stripos($ipv6addr, "fe80::") !== false) {
        $ipv6_local_addr = $ipv6addr;
    } else {
        $ipv6_global_addr = $ipv6addr;
    }
}
/*ipv6 dns*/
$idArr = explode(",", getInstanceIds("Device.DNS.Client.Server."));
foreach ($idArr as $key => $value) {
    if (!strcasecmp(php_getstr("Device.DNS.Client.Server.{$value}.Type"), "DHCPv6")) {
        $DNSv6Index = $value;
        break;
    }
}
$ipv6_DNS = php_getstr("Device.DNS.Client.Server.{$DNSv6Index}.DNSServer");
// $ipv6_local_addr = "fe80::250:f1ff:fe80:0";
// $ipv6_global_addr = "2018:cafe:aaaa::fccc";
// $ipv6_DNS = "2018:cafe::20c:29ff:fe97:fccc";
// !!! move "get hotspot status" to edit_public.php, no change on the "Edit" link
?>


<script type="text/javascript">
                header("Content-Type: application/json");
                echo json_encode($result);
            } else {
                if (isset($_POST['trace_ipv6_dst'])) {
                    $trace_ipv6_dst = $_POST['trace_ipv6_dst'];
                    $trace_ipv6_status = "Requested";
                    $trace_ipv6_result = array();
                    setStr("Device.IP.Diagnostics.TraceRoute.Host", $trace_ipv6_dst, true);
                    setStr("Device.IP.Diagnostics.TraceRoute.DiagnosticsState", $trace_ipv6_status, true);
                    do {
                        sleep(3);
                        $trace_ipv6_status = getStr("Device.IP.Diagnostics.TraceRoute.DiagnosticsState");
                        // $trace_ipv6_status = "Error_CannotResolveHostName";
                    } while (!in_array($trace_ipv6_status, $states_trace));
                    if ("Complete" == $trace_ipv6_status) {
                        $ids = explode(",", getInstanceIds("Device.IP.Diagnostics.TraceRoute.RouteHops."));
                        foreach ($ids as $i) {
                            $time = getStr("Device.IP.Diagnostics.TraceRoute.RouteHops.{$i}.RTTimes");
                            $host = getStr("Device.IP.Diagnostics.TraceRoute.RouteHops.{$i}.Host");
                            $addr = getStr("Device.IP.Diagnostics.TraceRoute.RouteHops.{$i}.HostAddress");
                            array_push($trace_ipv6_result, '<br/>' . $i . ': ' . $time . ' ' . $host . ' ' . $addr);
                        }
                    }
                    $result = array('trace_ipv6_status' => $trace_ipv6_status, 'trace_ipv6_result' => $trace_ipv6_result);
                    header("Content-Type: application/json");
                    echo json_encode($result);
                }
            }
        }
    }
}
示例#20
0
	<?php 
$hostsInstance = getInstanceIds("Device.Hosts.Host.");
$hostsInstanceArr = explode(",", $hostsInstance);
$hostNums = getStr("Device.Hosts.HostNumberOfEntries");
if ($_DEBUG) {
    $hostNums = "2";
}
for ($i = 0; $i < $hostNums; $i++) {
    $HostName = getStr("Device.Hosts.Host.{$hostsInstanceArr[$i]}.HostName");
    $IPAddress = getStr("Device.Hosts.Host.{$hostsInstanceArr[$i]}.IPAddress");
    $Active = getStr("Device.Hosts.Host.{$hostsInstanceArr[$i]}.Active");
    $IPv6Addr = "";
    $IPv6Num = getStr("Device.Hosts.Host.{$hostsInstanceArr[$i]}.IPv6AddressNumberOfEntries");
    if ((int) $IPv6Num > 0) {
        $ids = explode(",", getInstanceIds("Device.Hosts.Host.{$hostsInstanceArr[$i]}.IPv6Address."));
        foreach ($ids as $j) {
            if ($j === '') {
                break;
            }
            $val = getStr("Device.Hosts.Host.{$hostsInstanceArr[$i]}.IPv6Address.{$j}.IPAddress");
            if (stripos($val, "fe80:") === 0) {
                continue;
            }
            $IPv6Addr = $val;
            break;
        }
    }
    if ($_DEBUG) {
        $HostName = "Host " . ($i + 1);
        $IPAddress = "1.1.1." . ($i + 1);
示例#21
0
		<div>
			<h2>Home Network</h2>
			<?php 
if ("Disabled" == $_SESSION["psmMode"]) {
    /*
    				$InterfaceNumber=getStr("Device.Ethernet.InterfaceNumberOfEntries");$InterfaceEnable=0;
    				for($i=1;$i<=$InterfaceNumber;$i++){
    					$EthernetEnable=getStr("Device.Ethernet.Interface.".$i.".Enable");
    					$InterfaceEnable+=($EthernetEnable=="true"?1:0);
    				}
    				if ($InterfaceEnable==$InterfaceNumber) {
    					echo "<div class=\"form-row\"><span class=\"on-off\">On</span> <span class=\"readonlyLabel\">Ethernet</span></div>";
    				} else {
    					echo "<div class=\"form-row off\"><span class=\"on-off\">Off</span> <span class=\"readonlyLabel\">Ethernet</span></div>";
    				}*/
    $ids = explode(",", getInstanceIds("Device.Ethernet.Interface."));
    $ethEnable = false;
    foreach ($ids as $i) {
        if ("true" == getStr("Device.Ethernet.Interface." . $i . ".Enable")) {
            $ethEnable = true;
            break;
        }
    }
    if ($ethEnable) {
        echo "<div class=\"form-row\"><span class=\"on-off sprite_cont\"><img src=\"./cmn/img/icn_on_off.png\" alt='Ethernet On' /></span> <span class=\"readonlyLabel\">Ethernet</span></div>";
    } else {
        echo "<div class=\"form-row off\"><span class=\"on-off sprite_cont\"><img src=\"./cmn/img/icn_on_off.png\" alt='Ethernet Off' /></span> <span class=\"readonlyLabel\">Ethernet</span></div>";
    }
    // if (getStr("Device.WiFi.SSID.1.Enable")=="true" || getStr("Device.WiFi.SSID.2.Enable")=="true") {
    if ("true" == $sta_wifi) {
        // define in userhar, should have defined every componet status in userbar
示例#22
0
			}
			else{
				echo 'Remote Management Address (IPv4): ';
				echo '<br/>Remote Management Address (IPv6): ';
				echo $_SERVER["REMOTE_ADDR"];
			}*/
?>
			Remote Management Address (IPv4): 
			<?php 
$fistUSif = getStr("com.cisco.spvtg.ccsp.pam.Helper.FirstUpstreamIpInterface");
echo getStr($fistUSif . "IPv4Address.1.IPAddress");
?>
			<br/>
			Remote Management Address (IPv6): 		
			<?php 
$ids = explode(",", getInstanceIds($fistUSif . "IPv6Address."));
foreach ($ids as $i) {
    $val = getStr($fistUSif . "IPv6Address.{$i}.IPAddress");
    if (!strstr($val, "fe80::")) {
        echo $val;
        break;
    }
}
?>
		
			</strong></p>
		</div>
	</div> <!-- end .module -->
	<div class="module forms">
	    <h2>Remote Access Allowed From</h2><br/>
		<?php 
示例#23
0
		<div name="show_hide" id="msg_no_data1" style="display:none"><br/>There is no data to display for Line 1.</div>
		<div name="show_hide" id="msg_no_data2" style="display:none"><br/>There is no data to display for Line 2.</div>
	</div>

<?php 
$locale = array();
$remote = array();
$metric = array("Call End Time", "Call Start Time", "Call Duration", "Line Number", "Remote IP Address", "Codec", "CW Errors", "CW Error Rate", "SNR", "Micro Reflections", "Downstream Power", "Upstream Power", "EQI Average", "EQI Minimum", "EQI Maximum", "EQI Instantaneous", "MOS-LQ", "MOS-CQ", "Echo Return Loss", "Signal Level", "Noise Level", "Loss Rate", "Pkt Loss Concealment", "Discard Rate", "Burst Density", "Gap Density", "Burst Duration", "Gap Duration", "Round Trip Delay", "Remote Signal Level", "Gmin", "R Factor", "External R Factor", "Jitter Buf Adaptive", "Jitter Buf Rate", "JB Nominal Delay", "JB Max Delay", "JB Abs.Max Delay", "Tx Packets", "Tx Octets", "Rx Packets", "Rx Octets", "Packet Loss", "Interval Jitter", "Originator", "Remote Interval Jitter");
$mmmmmm = array("--", "--", "--", "--", "--", "Remote Codec", "--", "--", "--", "--", "--", "--", "--", "--", "--", "--", "Remote MOS-LQ", "Remote MOS-CQ", "Remote Echo Return Loss", "Remote Signal Level", "Remote Noise Level", "Remote Loss Rate", "Remote Pkt Loss Concealment", "Remote Discard Rate", "Remote Burst Density", "Remote Gap Density", "Remote Burst Duration", "Remote Gap Duration", "Remote Round Trip Delay", "Remote Signal Level", "Remote Gmin", "Remote R Factor", "Remote External R Factor", "Remote Jitter Buf Adaptive", "Remote Jitter Buf Rate", "Remote JB Nominal Delay", "Remote JB Max Delay", "Remote JB Abs.Max Delay", "--", "--", "--", "--", "--", "--", "--", "--");
// $line = array_filter(explode(",", getInstanceIds("Device.X_CISCO_COM_MTA.LineTable.")));
// $line = array(1,2);
// for ($i=0; $i<count($line); $i++)
if ("display" == $action) {
    $dmroot = "Device.X_CISCO_COM_MTA.LineTable.{$line}.VQM.Calls.";
    $dmval = DmExtGetStrsWithRootObj($dmroot, array($dmroot));
    $call = array_filter(explode(",", getInstanceIds($dmroot)));
    // sleep(3);
    $t = 66;
    //total parameters number in a call
    for ($j = 0; $j < count($call); $j++) {
        //locale metric for line 1 of this call number
        $locale[$j] = array($dmval[$j * $t + 3][1], $dmval[$j * $t + 4][1], $dmval[$j * $t + 10][1], $line, $dmval[$j * $t + 9][1], $dmval[$j * $t + 1][1], $dmval[$j * $t + 11][1], $dmval[$j * $t + 5][1], $dmval[$j * $t + 12][1], $dmval[$j * $t + 13][1], $dmval[$j * $t + 14][1], $dmval[$j * $t + 15][1], $dmval[$j * $t + 16][1], $dmval[$j * $t + 17][1], $dmval[$j * $t + 18][1], $dmval[$j * $t + 19][1], $dmval[$j * $t + 20][1], $dmval[$j * $t + 21][1], $dmval[$j * $t + 22][1], $dmval[$j * $t + 23][1], $dmval[$j * $t + 24][1], $dmval[$j * $t + 25][1], $dmval[$j * $t + 6][1], $dmval[$j * $t + 26][1], $dmval[$j * $t + 27][1], $dmval[$j * $t + 28][1], $dmval[$j * $t + 29][1], $dmval[$j * $t + 30][1], $dmval[$j * $t + 31][1], $dmval[$j * $t + 42][1], $dmval[$j * $t + 32][1], $dmval[$j * $t + 33][1], $dmval[$j * $t + 34][1], $dmval[$j * $t + 7][1], $dmval[$j * $t + 35][1], $dmval[$j * $t + 36][1], $dmval[$j * $t + 37][1], $dmval[$j * $t + 38][1], $dmval[$j * $t + 60][1], $dmval[$j * $t + 61][1], $dmval[$j * $t + 62][1], $dmval[$j * $t + 63][1], $dmval[$j * $t + 64][1], $dmval[$j * $t + 65][1], $dmval[$j * $t + 8][1], $dmval[$j * $t + 66][1]);
        //remote metric for line 1 of this call number
        $remote[$j] = array("--", "--", "--", "--", "--", $dmval[$j * $t + 2][1], "--", "--", "--", "--", "--", "--", "--", "--", "--", "--", $dmval[$j * $t + 39][1], $dmval[$j * $t + 40][1], $dmval[$j * $t + 41][1], $dmval[$j * $t + 42][1], $dmval[$j * $t + 43][1], $dmval[$j * $t + 44][1], $dmval[$j * $t + 45][1], $dmval[$j * $t + 46][1], $dmval[$j * $t + 47][1], $dmval[$j * $t + 48][1], $dmval[$j * $t + 49][1], $dmval[$j * $t + 50][1], $dmval[$j * $t + 51][1], $dmval[$j * $t + 42][1], $dmval[$j * $t + 52][1], $dmval[$j * $t + 53][1], $dmval[$j * $t + 54][1], $dmval[$j * $t + 55][1], $dmval[$j * $t + 56][1], $dmval[$j * $t + 57][1], $dmval[$j * $t + 58][1], $dmval[$j * $t + 59][1], "--", "--", "--", "--", "--", "--", "--", "--");
    }
}
?>

<?php 
// for ($n=0; $n<count($line); $n++)
if (count($call)) {