function selectTable($sp) { $ids = explode(",", getInstanceIDs("Device.X_CISCO_COM_DDNS.Service.")); foreach ($ids as $key => $j) { $spArr[$j] = getStr("Device.X_CISCO_COM_DDNS.Service." . $j . ".ServiceName"); if (strcasecmp($sp, $spArr[$j]) == 0) { return $j; } } return 0; }
include 'includes/nav.php'; ?> <?php //Start by licha $enableWMM = "false"; $enableMoCA = "false"; $APIDs = explode(",", getInstanceIDs("Device.WiFi.AccessPoint.")); for ($i = 0; $i < count($APIDs); $i++) { $enableWMM = getStr("Device.WiFi.AccessPoint." . $APIDs[$i] . ".WMMEnable"); if ($enableWMM == "true") { $enableWMM = "true"; break; } } $MoCAIDs = explode(",", getInstanceIDs("Device.MoCA.Interface.")); for ($i = 0; $i < count($MoCAIDs); $i++) { $enableMoCA = getStr("Device.MoCA.Interface." . $MoCAIDs[$i] . ".QoS.X_CISCO_COM_Enabled"); if ($enableMoCA == "true") { $enableMoCA = "true"; break; } } //$enableLAN = getStr("Device.X_CISCO_COM_DDNS.Enable"); //? R3 //$enableUPnP = getStr("Device.X_CISCO_COM_DDNS.Enable"); //? R3 //end by licha //add by shunjie "" == $enableWMM && ($enableWMM = "false"); "" == $enableMoCA && ($enableMoCA = "false"); ?>
<table class="data" summary="This table lists available port triggering entries"> <tr> <th id="service-name">Service Name</td> <th id="service-type">Service Type</td> <th id="trigger-port">Trigger Port(s)</td> <th id="target-port">Target port(s)</td> <th id="active">Active</td> <!-- <th id="edit-or-delete" colspan="2"> </th> --> <th id="edit-button"> </th> <th id="delete-button"> </th> </tr> <?php if (getStr("Device.NAT.X_CISCO_COM_PortTriggers.TriggerNumberOfEntries") == 0) { } else { $PTIDs = explode(",", getInstanceIDs("Device.NAT.X_CISCO_COM_PortTriggers.Trigger.")); //var_dump(count($PTIDs)); $iclass = "even"; foreach ($PTIDs as $key => $i) { if ($iclass == "even") { $iclass = "odd"; } else { $iclass = "even"; } $Protocol = getStr("Device.NAT.X_CISCO_COM_PortTriggers.Trigger." . $i . ".TriggerProtocol"); if ($Protocol == "BOTH") { $Protocol = "TCP/UDP"; } echo "\n\t\t \t<tr class={$iclass}>\n\t\t <td headers='service-name'>" . getStr("Device.NAT.X_CISCO_COM_PortTriggers.Trigger." . $i . ".Description") . "</td>\n\t\t <td headers='service-type'>" . $Protocol . "</td>\n\t\t\t\t<td headers='trigger-port'>" . getStr("Device.NAT.X_CISCO_COM_PortTriggers.Trigger." . $i . ".TriggerPortStart") . "~" . getStr("Device.NAT.X_CISCO_COM_PortTriggers.Trigger." . $i . ".TriggerPortEnd") . "</td>\n\t\t\t\t<td headers='target-port'>" . getStr("Device.NAT.X_CISCO_COM_PortTriggers.Trigger." . $i . ".ForwardPortStart") . "~" . getStr("Device.NAT.X_CISCO_COM_PortTriggers.Trigger." . $i . ".ForwardPortEnd") . "</td>"; if (getStr("Device.NAT.X_CISCO_COM_PortTriggers.Trigger." . $i . ".Enable") == "true") { echo "<td headers='active'><input tabindex='0' type=\"checkbox\" id=\"PortActive_{$i}\" name=\"PortActive\" checked=\"checked\" /><label for=\"PortActive_{$i}\" class='acs-hide'></label></td>";
<div class="module forms enable"> <h2>Managed Devices</h2> <div class="form-row"> <span class="readonlyLabel label">Managed Devices:</span> <span id="managed_devices_switch"></span> </div> <div class="form-row"> <label for="access_type">Access Type:</label> <span id="allow_block_switch"></span> </div> </div> <?php $MDIDs = explode(",", getInstanceIDs("Device.X_Comcast_com_ParentalControl.ManagedDevices.Device.")); $allowCnt = 0; $blockCnt = 0; $arrayAllowName = array(); $arrayBlockName = array(); foreach ($MDIDs as $key => $i) { $type = getStr("Device.X_Comcast_com_ParentalControl.ManagedDevices.Device." . $i . ".Type"); if ($type == "Allow") { $arrayAllowID[$allowCnt] = $i; $arrayAllowName[$allowCnt] = getStr("Device.X_Comcast_com_ParentalControl.ManagedDevices.Device." . $i . ".Description"); $arrayAllowMAC[$allowCnt] = getStr("Device.X_Comcast_com_ParentalControl.ManagedDevices.Device." . $i . ".MACAddress"); $blockStatus = getStr("Device.X_Comcast_com_ParentalControl.ManagedDevices.Device." . $i . ".AlwaysBlock"); if ($blockStatus == "true") { $arrayAllowStatus[$allowCnt] = "Always"; } else { if ($blockStatus == "false") {
* cross check whether above devices exist in Device.AccessPoint.{i}.associatedDevices.{i} * to determine it's online or offline * Device.DHCPv4.Server.Pool.1.Client.1.IPv4Address.1.IPAddress */ $rootObjName = "Device.DHCPv4.Server.Pool.2.Client."; $paramNameArray = array($rootObjName); $mapping_array = array("X_CISCO_COM_HostName", "Chaddr"); $PoolClientArr = getParaValues($rootObjName, $paramNameArray, $mapping_array, true); if ($_DEBUG) { $PoolClientArr = array(array('X_CISCO_COM_HostName' => 'xhs-client-1', 'Chaddr' => '00:00:ff:fe:ec:fb', '__id' => '1'), array('Chaddr' => '00:00:ff:fe:ec:fc', '__id' => '2'), array('Chaddr' => '00:00:ff:fe:ec:ac', '__id' => '3')); } foreach ($PoolClientArr as $k => $entry) { $PoolClientArr[$k] = array_merge($entry, array('IPv4Address' => getStr("Device.DHCPv4.Server.Pool.2.Client." . $PoolClientArr['__id'] . ".IPv4Address.1.IPAddress"))); } //dump($PoolClientArr); $ids = explode(",", getInstanceIDs("Device.WiFi.AccessPoint.3.AssociatedDevice.")); //MACAddress, SignalStrength, Active foreach ($ids as $k => $v) { $AssoDeviceArr[$k]['MACAddress'] = getStr("Device.WiFi.AccessPoint.3.AssociatedDevice.{$v}.MACAddress"); } if ($_DEBUG) { $AssoDeviceArr = array(array('MACAddress' => '00:00:ff:fe:ec:fa'), array('MACAddress' => '00:00:ff:fe:ec:fb'), array('MACAddress' => '00:00:ff:fe:ec:fc'), array('MACAddress' => '00:00:ff:fe:ec:fd')); } //dump($AssoDeviceArr); $onXHSClientArr = array(); $offXHSClientArr = array(); foreach ($PoolClientArr as $poolEntry) { foreach ($AssoDeviceArr as $wifiEntry) { if (!strcasecmp($poolEntry['Chaddr'], $wifiEntry['MACAddress'])) { array_push($onXHSClientArr, $poolEntry); }
$retStatus = DmExtSetStrsWithRootObj($rootObjName, TRUE, $paramArray); if (!$retStatus) { $result = "Success!"; } } } if (isset($_POST['active'])) { $isChecked = $_POST['isChecked']; $i = $_POST['id']; if (setStr("Device.NAT.PortMapping.{$i}.Enable", $isChecked, true) === true) { $result = "Success!"; } } if (isset($_REQUEST['del'])) { delTblObj("Device.NAT.PortMapping." . $_REQUEST['del'] . "."); Header("Location:../port_forwarding.php"); exit; } if ($result == "") { //the set operation failure due to conflict with port trigger rules or ... //so need to remove the '0.0.0.0' entry $ids = explode(",", getInstanceIDs("Device.NAT.PortMapping.")); foreach ($ids as $key => $j) { if (getStr("Device.NAT.PortMapping.{$j}.InternalClient") == "0.0.0.0") { delTblObj("Device.NAT.PortMapping.{$j}."); } } //end of foreach } //end of if echo json_encode($result);
<div class="module"> <div class="forms"> <h2>Add Device to be Blocked</h2> <h3>Set Blocked Device</h3> <label style="margin:20px 0 0 20px">Auto-Learned Devices:</label> <div class="form-row"> <table id="add_allowed_device" class="data"> <tr> <th class="number"> </th> <th class="computer_name">Computer Name</th> <th class="ip">MAC Address</th> </tr> <?php $hostIDs = explode(",", getInstanceIDs("Device.Hosts.Host.")); $iclass = ""; if (empty($hostIDs) || empty($hostIDs[0])) { $hostIDs = array(); } foreach ($hostIDs as $key => $i) { if ($iclass == "") { $iclass = "odd"; } else { $iclass = ""; } $hostName = getStr("Device.Hosts.Host." . $i . ".HostName"); $hostMac = getStr("Device.Hosts.Host." . $i . ".PhysAddress"); echo "\n\t\t\t\t\t\t\t<tr class={$iclass}>\n\t\t\t\t\t\t\t\t<th class=\"row-label alt\"><input name=\"computer\" id=\"{$hostMac}\" type=\"radio\" value=\"{$hostName}\" /></th>\n\t\t\t\t\t\t\t\t<td>" . $hostName . "</td>\n\t\t\t\t\t\t\t\t<td>" . $hostMac . "</td>\n\t\t\t\t\t\t\t</tr>"; } ?>
<div class="module data"> <h2>Dynamic DNS</h2> <p class="button"><a href="dynamic_dns_add.php" class="btn" id="add-service">+ ADD DDNS</a></p> <table class="data"> <tr> <td class="acs-th">Service Provider</td> <td class="acs-th">User Name</td> <td class="acs-th">Password</td> <td class="acs-th">HostName(s)</td> <td class="acs-th" colspan="2"> </td> </tr> <?php $num = getStr("Device.X_CISCO_COM_DDNS.ServiceNumberOfEntries"); if ($num != 0) { $IDs = explode(",", getInstanceIDs("Device.X_CISCO_COM_DDNS.Service.")); $iclass = ""; foreach ($IDs as $key => $i) { $enableSrv = getStr("Device.X_CISCO_COM_DDNS.Service." . "{$i}" . ".Enable"); if ($enableSrv == "true") { if ($iclass == "") { $iclass = "odd"; } else { $iclass = ""; } $name = getStr("Device.X_CISCO_COM_DDNS.Service." . "{$i}" . ".ServiceName"); $username = getStr("Device.X_CISCO_COM_DDNS.Service." . "{$i}" . ".Username"); $password = getStr("Device.X_CISCO_COM_DDNS.Service." . "{$i}" . ".Password"); $passwordStr = ""; for ($j = 0; $j < strlen($password); $j++) { $passwordStr = $passwordStr . "*";