Changeset 873 for trunk/Modules/NetworkConfigRouterOS/Generators/DNS.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Generators/DNS.php
r781 r873 13 13 14 14 $DbResult = $this->Database->query('SELECT * FROM `NetworkDomain`'); 15 while ($Domain = $DbResult->fetch_assoc())15 while ($Domain = $DbResult->fetch_assoc()) 16 16 { 17 17 $DomainName = $Domain['Name']; … … 19 19 // Get full domain name from parent items 20 20 $CurrentDomain = $Domain; 21 while ($CurrentDomain['Parent'] > 0)21 while ($CurrentDomain['Parent'] > 0) 22 22 { 23 23 $DbResult2 = $this->Database->query('SELECT * FROM `NetworkDomain` WHERE `Id`='.$CurrentDomain['Parent']); … … 32 32 'JOIN `NetworkDevice` ON `NetworkInterface`.`Device`=`NetworkDevice`.`Id` '. 33 33 'WHERE (`NetworkDevice`.`Used`=1)'); 34 while ($Interface = $DbResult2->fetch_assoc())34 while ($Interface = $DbResult2->fetch_assoc()) 35 35 { 36 36 $Name = $Interface['DeviceName']; 37 if ($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];37 if ($Interface['Name'] != '') $Name .= '-'.$Interface['Name']; 38 38 $NameFull = $Name.'.'.$DomainName; 39 39 $NameExtFull = $Name.'-ext.'.$DomainName; 40 if ($Interface['LocalIP'] != '')40 if ($Interface['LocalIP'] != '') 41 41 $Items[] = array('name' => $NameFull, 'address' => $Interface['LocalIP']); 42 if ($Interface['IPv6'] != '')42 if ($Interface['IPv6'] != '') 43 43 $Items[] = array('name' => $NameFull, 'address' => $Interface['IPv6']); 44 if ($Interface['ExternalIP'] != '')44 if ($Interface['ExternalIP'] != '') 45 45 $Items[] = array('name' => $NameExtFull, 'address' => $Interface['ExternalIP']); 46 46 } … … 53 53 'WHERE (`NetworkDevice`.`Used`=1) AND '. 54 54 '(CONCAT_WS("-", `NetworkDevice`.`Name`, NULLIF(`NetworkInterface`.`Name`, "")) = `NetworkDomainAlias`.`Target`)'); 55 while ($Alias = $DbResult2->fetch_assoc())55 while ($Alias = $DbResult2->fetch_assoc()) 56 56 { 57 57 $Name = $Alias['Name']; 58 58 $NameFull = $Name.'.'.$DomainName; 59 59 $NameExtFull = $Name.'-ext.'.$DomainName; 60 if ($Alias['LocalIP'] != '')60 if ($Alias['LocalIP'] != '') 61 61 $Items[] = array('name' => $NameFull, 'address' => $Alias['LocalIP']); 62 if ($Alias['IPv6'] != '')62 if ($Alias['IPv6'] != '') 63 63 $Items[] = array('name' => $NameFull, 'address' => $Alias['IPv6']); 64 if ($Alias['ExternalIP'] != '')64 if ($Alias['ExternalIP'] != '') 65 65 $Items[] = array('name' => $NameExtFull, 'address' => $Alias['ExternalIP']); 66 66 } 67 67 68 68 $DbResult2 = $this->Database->query('SELECT * FROM `NetworkDomainServer` WHERE `Domain`='.$Domain['Id']); 69 while ($Server = $DbResult2->fetch_assoc())69 while ($Server = $DbResult2->fetch_assoc()) 70 70 { 71 71 $Routerboard->HostName = $Server['Address'];
Note:
See TracChangeset
for help on using the changeset viewer.