- Timestamp:
- Sep 28, 2009, 1:35:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/dhcp_routerboard.php
r248 r249 16 16 echo($Subnet['DHCP']); 17 17 $Routerboard->HostName = $Subnet['DHCP']; 18 $I = explode('.', $Subnet['AddressRange']);19 $I = $I[2];20 18 $Items = array(); 21 $DbResult2 = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM `NetworkInterface` LEFT JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE (`LocalIP` LIKE "192.168.'.$I.'.%") AND (`MAC` != "00:00:00:00:00:00") ORDER BY `LocalIP`'); 19 $Server = 'dhcp'.$Subnet['Id']; 20 $DbResult2 = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM `NetworkInterface` LEFT JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE '. 21 ' CompareNetworkPrefix(INET_ATON(LocalIP), INET_ATON("'.$Subnet['AddressRange'].'"), '.$Subnet['Mask'].') AND (`MAC` != "00:00:00:00:00:00") ORDER BY `LocalIP`'); 22 echo($Database->error); 22 23 while($Interface = $DbResult2->fetch_assoc()) 23 24 { 24 25 $Name = $Interface['DeviceName']; 25 26 if($Interface['Name'] != '') $Name .= '-'.$Interface['Name']; 26 $Items[] = array('mac-address' => $Interface['MAC'], 'address' => $Interface['LocalIP'], 'server' => 'dhcp'.$I, 'comment' => $Name);27 $Items[] = array('mac-address' => $Interface['MAC'], 'address' => $Interface['LocalIP'], 'server' => $Server, 'comment' => $Name); 27 28 } 28 29 29 print_r($Routerboard->ListUpdate($Path, array('mac-address', 'address', 'server', 'comment'), $Items, array('server' => 'dhcp'.$I)));30 print_r($Routerboard->ListUpdate($Path, array('mac-address', 'address', 'server', 'comment'), $Items, array('server' => $Server))); 30 31 echo("\n"); 31 32 }
Note:
See TracChangeset
for help on using the changeset viewer.