//$extras[$array_mac[$i]]['hostname'] = $array_hostname[$i];	// Should we show this?
         $extras[$array_mac[$i]]['rssi'] = $array_rssi[$i];
         $extras[$array_mac[$i]]['dbm'] = $array_dbm[$i];
     }
     $i = $i + 1;
 }
 foreach ($data as $item) {
     if (strpos($item, 'top_users=') !== FALSE) {
         $data = str_replace("top_users=", "", $item);
         $data = explode("+", $data);
         foreach ($data as $client) {
             $data = explode(",", $client);
             if (strlen($data[0]) > 1) {
                 $clientname = $data[4];
                 $clientmac = $data[3];
                 $vendor = ouilookup($clientmac);
                 if (strlen($vendor) < 2) {
                     mail("*****@*****.**", "Bug Report", "The vendor for the MAC address: " . $clientmac . " could not be identified.\n" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
                 }
                 echo "<tr style=\"border:1px gray solid;\">\n";
                 echo "<td style=\"text-align:left;\">" . $clientname . "<br>" . $clientmac . "</td>\n";
                 echo "<td style=\"text-align:left;\">" . $node->name . "<br />" . $node->mac . "</td>\n";
                 echo "<td style=\"text-align:left;\">" . $vendor . "</td>\n";
                 if ($extras[$clientmac]['rssi'] == "") {
                     echo "<td>n/a</td>\n";
                 } else {
                     echo "<td>" . $extras[$clientmac]['rssi'] . "</td>\n";
                 }
                 if ($extras[$clientmac]['dbm'] == "") {
                     echo "<td>n/a</td>\n";
                 } else {
Example #2
0
				<input type="hidden" id="zoom_level">
				<input type="hidden" name="location" id="location" />
				<input type="hidden" name="action" value="add" />
			<?php
			echo "<br /><input type=\"button\" style=\"width:20%;\" onclick=\"document.location = './edit-node.php';\" name=\"button\"  value=\"Cancel\"> <input type=\"submit\" style=\"font-weight:bold;width:63%;\" name=\"sent\" value=\"Add Node\" />";
			}
			else {
				$xmlp = simplexml_load_file($dir . "data/" . $networkname . "_nodes.xml");
				
				include($dir . "resources/ouilookup.php");	// For looking up the vendor of the device
				include($dir . "resources/ubntlookup.php");	// For looking up the model of the device (Ubiquiti devices only)
				
				$i = 0;

				foreach($xmlp->node as $node) {
					$vendor = ouilookup($node->mac);
					$vendor = explode(" ", $vendor);
					$idstring = $vendor[0];
					
					if(substr(str_replace(":", "", $node->mac), 0, 6) == "00156D" || substr(str_replace(":", "", $node->mac), 0, 6) == "002722") {
						$model = ubntlookup($node->mac);
						$model = explode(" ", $model);
						$idstring .= " " . $model[0];
					}
					
					if($i == 0) {echo "<h2>Nodes</h2>\n\n<table style=\"width:83%;\">\n";}
					echo "<tr style=\"margin-left:2px;border: 2px solid #ccc;\">\n<td style=\"width:15%;\">" . $idstring . "</td>\n<td style=\"text-align:left;\">" . $node->name . "</td>\n<td>" . $node->ip . "</td>\n<td>" . $node->mac . "</td>\n<td><a href=\"edit-node.php?action=configure&ip=" . $node->ip . "&mac=" . $node->mac . "\">Configure</a></td>\n<td><a href=\"edit-node.php?action=remove&ip=" . $node->ip . "&mac=" . $node->mac . "\">Remove</a></td>\n</tr>\n\n";

					$i = $i + 1;
				}