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/Netwatch.php

    r521 r522  
    22
    33if(isset($_SERVER['REMOTE_ADDR'])) die();
    4 include('../../Common/Global.php');
    5 include('../routerboard.php');
     4include_once(dirname(__FILE__).'/../../../Common/Global.php');
     5include_once(dirname(__FILE__).'/../Routerboard.php');
    66$Path = array('tool', 'netwatch');
    7 $Database = &$System->Database;
    87
    98$Routerboard = new Routerboard();
     
    1211$Routerboard->Debug = true;
    1312
    14 $DbResult3 = $Database->query('SELECT DISTINCT (`DHCP`) FROM `NetworkSubnet` WHERE `Configure` = 1'); // WHERE `Member` = 0');
     13$DbResult3 = $System->Database->query('SELECT DISTINCT (`DHCP`) FROM `NetworkSubnet` WHERE `Configure` = 1'); // WHERE `Member` = 0');
    1514while($Router = $DbResult3->fetch_assoc())
    1615{
     
    1817  $Routerboard->HostName = $Router['DHCP'];
    1918  $Items = array();
    20   $DbResult = $Database->query('SELECT * FROM `NetworkSubnet` WHERE (`Configure` = 1) AND (`DHCP`="'.$Router['DHCP'].'")');
     19  $DbResult = $System->Database->query('SELECT * FROM `NetworkSubnet` WHERE (`Configure` = 1) AND (`DHCP`="'.$Router['DHCP'].'")');
    2120  while($Subnet = $DbResult->fetch_assoc())
    2221  {
    2322    $I = explode('.', $Subnet['AddressRange']);
    2423    $I = $I[2];
    25     $DbResult2 = $Database->query('SELECT `NetworkInterface`.*, `NetworkDevice`.`Name` AS `DeviceName` FROM `NetworkInterface`'.
     24    $DbResult2 = $System->Database->query('SELECT `NetworkInterface`.*, `NetworkDevice`.`Name` AS `DeviceName` FROM `NetworkInterface`'.
    2625    ' LEFT JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` WHERE CompareNetworkPrefix(INET_ATON(`LocalIP`), INET_ATON("'.$Subnet['AddressRange'].'"), '.$Subnet['Mask'].')'.
    2726    ' AND (`NetworkDevice`.`Used` = 1) ORDER BY `NetworkInterface`.`LocalIP`');
Note: See TracChangeset for help on using the changeset viewer.