Ignore:
Timestamp:
Apr 6, 2020, 11:17:40 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code format.
File:
1 edited

Legend:

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

    r781 r873  
    1313
    1414    $DbResult = $this->Database->query('SELECT * FROM `NetworkDomain`');
    15     while($Domain = $DbResult->fetch_assoc())
     15    while ($Domain = $DbResult->fetch_assoc())
    1616    {
    1717      $DomainName = $Domain['Name'];
     
    1919      // Get full domain name from parent items
    2020      $CurrentDomain = $Domain;
    21       while($CurrentDomain['Parent'] > 0)
     21      while ($CurrentDomain['Parent'] > 0)
    2222      {
    2323        $DbResult2 = $this->Database->query('SELECT * FROM `NetworkDomain` WHERE `Id`='.$CurrentDomain['Parent']);
     
    3232          'JOIN `NetworkDevice` ON `NetworkInterface`.`Device`=`NetworkDevice`.`Id` '.
    3333          'WHERE (`NetworkDevice`.`Used`=1)');
    34       while($Interface = $DbResult2->fetch_assoc())
     34      while ($Interface = $DbResult2->fetch_assoc())
    3535      {
    3636        $Name = $Interface['DeviceName'];
    37         if($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];
     37        if ($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];
    3838        $NameFull = $Name.'.'.$DomainName;
    3939        $NameExtFull = $Name.'-ext.'.$DomainName;
    40         if($Interface['LocalIP'] != '')
     40        if ($Interface['LocalIP'] != '')
    4141          $Items[] = array('name' => $NameFull, 'address' => $Interface['LocalIP']);
    42         if($Interface['IPv6'] != '')
     42        if ($Interface['IPv6'] != '')
    4343          $Items[] = array('name' => $NameFull, 'address' => $Interface['IPv6']);
    44         if($Interface['ExternalIP'] != '')
     44        if ($Interface['ExternalIP'] != '')
    4545          $Items[] = array('name' => $NameExtFull, 'address' => $Interface['ExternalIP']);
    4646      }
     
    5353          'WHERE (`NetworkDevice`.`Used`=1) AND '.
    5454          '(CONCAT_WS("-", `NetworkDevice`.`Name`, NULLIF(`NetworkInterface`.`Name`, "")) = `NetworkDomainAlias`.`Target`)');
    55       while($Alias = $DbResult2->fetch_assoc())
     55      while ($Alias = $DbResult2->fetch_assoc())
    5656      {
    5757        $Name = $Alias['Name'];
    5858        $NameFull = $Name.'.'.$DomainName;
    5959        $NameExtFull = $Name.'-ext.'.$DomainName;
    60         if($Alias['LocalIP'] != '')
     60        if ($Alias['LocalIP'] != '')
    6161          $Items[] = array('name' => $NameFull, 'address' => $Alias['LocalIP']);
    62         if($Alias['IPv6'] != '')
     62        if ($Alias['IPv6'] != '')
    6363          $Items[] = array('name' => $NameFull, 'address' => $Alias['IPv6']);
    64         if($Alias['ExternalIP'] != '')
     64        if ($Alias['ExternalIP'] != '')
    6565          $Items[] = array('name' => $NameExtFull, 'address' => $Alias['ExternalIP']);
    6666      }
    6767
    6868      $DbResult2 = $this->Database->query('SELECT * FROM `NetworkDomainServer` WHERE `Domain`='.$Domain['Id']);
    69       while($Server = $DbResult2->fetch_assoc())
     69      while ($Server = $DbResult2->fetch_assoc())
    7070      {
    7171        $Routerboard->HostName = $Server['Address'];
Note: See TracChangeset for help on using the changeset viewer.