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

    r521 r522  
    22
    33if(isset($_SERVER['REMOTE_ADDR'])) die();
    4 include('../../Common/Global.php');
    5 $Database = &$System->Database;
     4include_once(dirname(__FILE__).'/../../../Common/Global.php');
    65
    76$BaseDomain = 'zdechov.net';
     
    122121
    123122// Local records
    124 $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.LocalIP <> ""');
     123$DbResult = $System->Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.LocalIP <> ""');
    125124while($Interface = $DbResult->fetch_assoc())
    126125{
     
    131130
    132131// External records in internal server
    133 $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.ExternalIP <> ""');
     132$DbResult = $System->Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.ExternalIP <> ""');
    134133while($Interface = $DbResult->fetch_assoc())
    135134{
     
    151150
    152151// Domain aliases
    153 $DbResult = $Database->select('NetworkDomainAlias', '*');
     152$DbResult = $System->Database->select('NetworkDomainAlias', '*');
    154153while($Alias = $DbResult->fetch_assoc())
    155154{
     
    177176);
    178177
    179 $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.ExternalIP != ""');
     178$DbResult = $System->Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.ExternalIP != ""');
    180179while($Interface = $DbResult->fetch_assoc())
    181180{
     
    186185
    187186// Domain alias
    188 $DbResult = $Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias`');
     187$DbResult = $System->Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias`');
    189188// JOIN `NetworkDevice` ON NetworkDomainAlias.Target LIKE NetworkDevice.Name AND NetworkInterface.ExternalIP != ""');
    190189while($Alias = $DbResult->fetch_assoc())
     
    215214
    216215// Hosts
    217 $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.LocalIP != ""');
     216$DbResult = $System->Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.LocalIP != ""');
    218217while($Interface = $DbResult->fetch_assoc())
    219218{
     
    224223
    225224// Domain alias
    226 $DbResult = $Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias`');
     225$DbResult = $System->Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias`');
    227226// JOIN `hosts` ON NetworkDomainAlias.Target LIKE hosts.name AND hosts.czfree_ip != ""');
    228227while($Alias = $DbResult->fetch_assoc())
     
    252251
    253252// Hosts
    254 $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.LocalIP != ""');
     253$DbResult = $System->Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.LocalIP != ""');
    255254while($Interface = $DbResult->fetch_assoc())
    256255{
     
    262261
    263262// Domain alias
    264 $DbResult = $Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias`');
     263$DbResult = $System->Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias`');
    265264// JOIN `hosts` ON NetworkDomainAlias.Target LIKE hosts.name AND hosts.czfree_ip != ""');
    266265while($Alias = $DbResult->fetch_assoc())
Note: See TracChangeset for help on using the changeset viewer.