Changeset 798 for trunk/Modules/NetworkConfigLinux/Generators/DNS.php
- Timestamp:
- Feb 6, 2016, 8:04:17 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigLinux/Generators/DNS.php
r790 r798 155 155 $MinimumTime = 10800; 156 156 $TTL = 86400; 157 //$BaseDir = '/var/named';158 $BaseDir = '/home/chronos/Projekty/centrala/trunk/var/named';157 $BaseDir = '/var/named'; 158 //$BaseDir = '/home/chronos/Projekty/centrala/trunk/var/named'; 159 159 if(!file_exists($BaseDir)) die('Base directory "'.$BaseDir.'" not exists.'); 160 160 $MailServer = 'centrala'; … … 183 183 184 184 // Local records 185 $DbResult = $this->Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface '. 186 'JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.LocalIP <> ""'); 185 $DbResult = $this->Database->query('SELECT `NetworkInterface`.*, `NetworkDevice`.`Name` AS `DeviceName` '. 186 'FROM `NetworkInterface` '. 187 'JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` '. 188 'WHERE (`NetworkInterface`.`LocalIP` <> "") AND (`NetworkDevice`.`Used` = 1)'); 187 189 while($Interface = $DbResult->fetch_assoc()) 188 190 { … … 194 196 195 197 // External IPv4 records in internal server 196 $DbResult = $this->Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface '. 197 'JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.ExternalIP <> ""'); 198 $DbResult = $this->Database->query('SELECT `NetworkInterface`.*, `NetworkDevice`.`Name` AS `DeviceName` FROM `NetworkInterface` '. 199 'JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` '. 200 'WHERE (`NetworkInterface`.`ExternalIP` <> "") AND (`NetworkDevice`.`Used` = 1)'); 198 201 while($Interface = $DbResult->fetch_assoc()) 199 202 { … … 243 246 ); 244 247 245 $DbResult = $this->Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface '. 246 'JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.ExternalIP != ""'); 248 $DbResult = $this->Database->query('SELECT `NetworkInterface`.*, `NetworkDevice`.`Name` AS `DeviceName` FROM `NetworkInterface` '. 249 'JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` WHERE '. 250 '(`NetworkInterface`.`ExternalIP` != "") AND (`NetworkDevice`.`Used` = 1)'); 247 251 while($Interface = $DbResult->fetch_assoc()) 248 252 { … … 254 258 255 259 // Domain alias 256 $DbResult = $this->Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias`');260 $DbResult = $this->Database->query('SELECT `NetworkDomainAlias`.* FROM `NetworkDomainAlias`'); 257 261 // JOIN `NetworkDevice` ON NetworkDomainAlias.Target LIKE NetworkDevice.Name AND NetworkInterface.ExternalIP != ""'); 258 262 while($Alias = $DbResult->fetch_assoc()) … … 285 289 286 290 // Hosts 287 $DbResult = $this->Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface '. 288 'JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.LocalIP != ""'); 291 $DbResult = $this->Database->query('SELECT `NetworkInterface`.*, `NetworkDevice`.`Name` AS `DeviceName` FROM `NetworkInterface` '. 292 'JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` '. 293 'WHERE (`NetworkInterface`.`LocalIP` != "") AND (`NetworkDevice`.`Used` = 1)'); 289 294 while($Interface = $DbResult->fetch_assoc()) 290 295 { … … 295 300 296 301 // Domain alias 297 $DbResult = $this->Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias`');302 $DbResult = $this->Database->query('SELECT `NetworkDomainAlias`.* FROM `NetworkDomainAlias`'); 298 303 // JOIN `hosts` ON NetworkDomainAlias.Target LIKE hosts.name AND hosts.czfree_ip != ""'); 299 304 while($Alias = $DbResult->fetch_assoc()) … … 325 330 326 331 // Hosts 327 $DbResult = $this->Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface'.328 'JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.LocalIP!= ""');332 $DbResult = $this->Database->query('SELECT `NetworkInterface`.*, `NetworkDevice`.`Name` AS `DeviceName` FROM `NetworkInterface` '. 333 'JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` WHERE `NetworkInterface`.`LocalIP` != ""'); 329 334 while($Interface = $DbResult->fetch_assoc()) 330 335 { … … 336 341 337 342 // Domain alias 338 $DbResult = $this->Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias`');343 $DbResult = $this->Database->query('SELECT `NetworkDomainAlias`.* FROM `NetworkDomainAlias`'); 339 344 // JOIN `hosts` ON NetworkDomainAlias.Target LIKE hosts.name AND hosts.czfree_ip != ""'); 340 345 while($Alias = $DbResult->fetch_assoc())
Note:
See TracChangeset
for help on using the changeset viewer.