Ignore:
Timestamp:
Apr 15, 2013, 11:08:49 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Skritpy generátorů nastavení routerů přetvořeny na aplikační moduly NetworkConfig.
Location:
trunk/Modules/NetworkConfigRouterOS
Files:
2 added
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfigRouterOS/Generators/FirewallNAT.php

    r521 r522  
    22
    33if(isset($_SERVER['REMOTE_ADDR'])) die();
    4 include('../../Common/Global.php');
    5 include('../routerboard.php');
    6 include('common.php');
     4include_once(dirname(__FILE__).'/../../../Common/Global.php');
     5include_once(dirname(__FILE__).'/../Routerboard.php');
     6include_once('Common.php');
    77$Path = array('ip', 'firewall', 'nat');
    8 $Database = &$System->Database;
    98
    109$Routerboard = new Routerboard($Config['MainRouter']['HostName']);
     
    3736//$Items[] = array('chain' => 'inet-in', 'dst-address' => '172.16.1.1/30', 'action' => 'accept', 'comment' => 'Local_subnet');
    3837
    39 $DbResult = $Database->query('SELECT `Member`.*, `Subject`.`Name` FROM `Member` '.
     38$DbResult = $System->Database->query('SELECT `Member`.*, `Subject`.`Name` FROM `Member` '.
    4039  'LEFT JOIN `Subject` ON `Subject`.`Id` = `Member`.`Subject` '.
    4140  'WHERE `Member`.`Blocked` = 0');
     
    4443  echo($Member['Name'].': ');
    4544  // 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`'.
    4746  ' LEFT JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` WHERE (`NetworkInterface`.`ExternalIP` <> "")'.
    4847  ' AND (`NetworkDevice`.`Member` = '.$Member['Id'].') AND (`NetworkInterface`.`LocalIP` != `NetworkInterface`.`ExternalIP`) ORDER BY `id` DESC');
     
    6564
    6665  // Subnets
    67   $DbResult2 = $Database->select('NetworkSubnet', '*', '`Member`='.$Member['Id']);
     66  $DbResult2 = $System->Database->select('NetworkSubnet', '*', '`Member`='.$Member['Id']);
    6867  while($Subnet = $DbResult2->fetch_assoc())
    6968  {   
     
    115114/*
    116115// 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');
    118117while($Member = $DbResult->fetch_assoc())
    119118{
    120119  echo($Member['Name'].': ');
    121120  // 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');
    123122  while($Interface = $DbResult2->fetch_assoc())
    124123  {
Note: See TracChangeset for help on using the changeset viewer.