- Timestamp:
- Apr 15, 2013, 11:08:49 PM (12 years ago)
- Location:
- trunk/Modules/NetworkConfigRouterOS
- Files:
-
- 2 added
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Generators/FirewallNAT.php
r521 r522 2 2 3 3 if(isset($_SERVER['REMOTE_ADDR'])) die(); 4 include ('../../Common/Global.php');5 include ('../routerboard.php');6 include ('common.php');4 include_once(dirname(__FILE__).'/../../../Common/Global.php'); 5 include_once(dirname(__FILE__).'/../Routerboard.php'); 6 include_once('Common.php'); 7 7 $Path = array('ip', 'firewall', 'nat'); 8 $Database = &$System->Database;9 8 10 9 $Routerboard = new Routerboard($Config['MainRouter']['HostName']); … … 37 36 //$Items[] = array('chain' => 'inet-in', 'dst-address' => '172.16.1.1/30', 'action' => 'accept', 'comment' => 'Local_subnet'); 38 37 39 $DbResult = $ Database->query('SELECT `Member`.*, `Subject`.`Name` FROM `Member` '.38 $DbResult = $System->Database->query('SELECT `Member`.*, `Subject`.`Name` FROM `Member` '. 40 39 'LEFT JOIN `Subject` ON `Subject`.`Id` = `Member`.`Subject` '. 41 40 'WHERE `Member`.`Blocked` = 0'); … … 44 43 echo($Member['Name'].': '); 45 44 // Hosts 46 $DbResult2 = $ Database->query('SELECT `NetworkInterface`.*, `NetworkDevice`.`Name` AS `DeviceName`, `NetworkDevice`.`InboundNATPriority` FROM `NetworkInterface`'.45 $DbResult2 = $System->Database->query('SELECT `NetworkInterface`.*, `NetworkDevice`.`Name` AS `DeviceName`, `NetworkDevice`.`InboundNATPriority` FROM `NetworkInterface`'. 47 46 ' LEFT JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` WHERE (`NetworkInterface`.`ExternalIP` <> "")'. 48 47 ' AND (`NetworkDevice`.`Member` = '.$Member['Id'].') AND (`NetworkInterface`.`LocalIP` != `NetworkInterface`.`ExternalIP`) ORDER BY `id` DESC'); … … 65 64 66 65 // Subnets 67 $DbResult2 = $ Database->select('NetworkSubnet', '*', '`Member`='.$Member['Id']);66 $DbResult2 = $System->Database->select('NetworkSubnet', '*', '`Member`='.$Member['Id']); 68 67 while($Subnet = $DbResult2->fetch_assoc()) 69 68 { … … 115 114 /* 116 115 // Route public addresses localy 117 $DbResult = $ Database->query('SELECT Member.*, Subject.Name FROM Member JOIN Subject ON Member.Subject = Subject.Id');116 $DbResult = $System->Database->query('SELECT Member.*, Subject.Name FROM Member JOIN Subject ON Member.Subject = Subject.Id'); 118 117 while($Member = $DbResult->fetch_assoc()) 119 118 { 120 119 echo($Member['Name'].': '); 121 120 // Hosts 122 $DbResult2 = $ Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface LEFT JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE (NetworkInterface.ExternalIP <> "") AND (NetworkDevice.Member = '.$Member['Id'].') AND (NetworkInterface.LocalIP != NetworkInterface.ExternalIP) ORDER BY id DESC');121 $DbResult2 = $System->Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface LEFT JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE (NetworkInterface.ExternalIP <> "") AND (NetworkDevice.Member = '.$Member['Id'].') AND (NetworkInterface.LocalIP != NetworkInterface.ExternalIP) ORDER BY id DESC'); 123 122 while($Interface = $DbResult2->fetch_assoc()) 124 123 {
Note:
See TracChangeset
for help on using the changeset viewer.