Changeset 37 for system/generators/dns.php
- Timestamp:
- Jan 31, 2008, 8:38:47 PM (17 years ago)
- Location:
- system
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
system
-
Property svn:ignore
set to
nohup.out
-
Property svn:ignore
set to
-
system/generators/dns.php
r7 r37 1 <? 2 include('global.php'); 3 include_once('../../html/is/db.php'); 4 DB_Init('localhost', 'root', '', 'is'); 1 <?php 2 include_once('../../html/global.php'); 5 3 6 4 //$Serial = '2007070601'; // Should be changed on every change … … 28 26 "\t\t\tMX\t10 mail.zdechov.net.\n"); 29 27 30 DB_Select('hosts','*',' block < 2 AND IP <> ""');31 while($Row = DB_Row())28 $DbResult = $Database->select('hosts','*',' block < 2 AND IP <> ""'); 29 while($Row = $DbResult->fetch_array()) 32 30 { 33 31 $Data = strtolower($Row['name']); … … 37 35 38 36 // External records in internal server 39 DB_Select('hosts','*','external_ip<>""');40 while($Row = DB_Row())37 $DbResult = $Database->select('hosts','*','external_ip<>""'); 38 while($Row = $DbResult->fetch_array()) 41 39 { 42 40 $Data = strtolower($Row['name']).'-ext'; … … 45 43 } 46 44 47 DB_Select('network_dns_alias', '*');48 while($Alias = DB_Row())45 $DbResult = $Database->select('network_dns_alias', '*'); 46 while($Alias = $DbResult->fetch_array()) 49 47 { 50 48 $Data = strtolower($Alias['name']); … … 71 69 "\t\t\t\t)\n". 72 70 "@\tIN\tNS\tcentrala.zdechov.net.\n\n"); 73 DB_Select('hosts','*','IP LIKE "'.$Network.'%"');74 while($Row = DB_Row())71 $DbResult = $Database->select('hosts','*','IP LIKE "'.$Network.'%"'); 72 while($Row = $DbResult->fetch_array()) 75 73 { 76 74 $IP = explode('.',$Row['IP']); … … 96 94 "\t\t\t\t)\n". 97 95 "@\tIN\tNS\tcentrala.zdechov.net.\n\n"); 98 DB_Select('hosts','*','external_ip LIKE "'.$Network.'.%"');99 while($Row = DB_Row())96 $DbResult = $Database->select('hosts','*','external_ip LIKE "'.$Network.'.%"'); 97 while($Row = $DbResult->fetch_array()) 100 98 { 101 99 $IP = explode('.',$Row['external_ip']); … … 126 124 fputs($File, $Header); 127 125 128 DB_Select('hosts','*','external_ip<>""');129 while($Row = DB_Row())126 $DbResult = $Database->select('hosts','*','external_ip<>""'); 127 while($Row = $DbResult->fetch_array()) 130 128 { 131 129 $Data = strtolower($Row['name']); … … 134 132 } 135 133 136 DB_Query("SELECT network_dns_alias.* FROM `network_dns_alias` JOIN `hosts` ON network_dns_alias.target LIKE hosts.name AND hosts.external_ip != ''");137 while($Alias = DB_Row())134 $DbResult = $Database->query("SELECT network_dns_alias.* FROM `network_dns_alias` JOIN `hosts` ON network_dns_alias.target LIKE hosts.name AND hosts.external_ip != ''"); 135 while($Alias = $DbResult->fetch_array()) 138 136 { 139 137 $Data = strtolower($Alias['name']); … … 161 159 "@\tIN\tNS\t".$ExternalServerName.".\n\n". 162 160 "\t\t\tNS\tplandsfeld.avonet.cz.\n"); 163 DB_Select('hosts','*','external_ip LIKE "'.$Network.'.%"'); 164 while($Row = DB_Row()) 161 162 $DbResult = $Database->select('hosts','*','external_ip LIKE "'.$Network.'.%"'); 163 while($Row = $DbResult->fetch_array()) 165 164 { 166 165 $IP = explode('.',$Row['external_ip']); … … 209 208 fputs($File2, $Header); 210 209 211 DB_Select('hosts','*','czfree_ip<>""');212 while($Row = DB_Row())210 $Database->select('hosts','*','czfree_ip<>""'); 211 while($Row = $Database->fetch_array()) 213 212 { 214 213 $Data = strtolower($Row['name']); 215 if(strlen($Data) <8) $Data .= "\t";214 if(strlen($Data) < 8) $Data .= "\t"; 216 215 fputs($File,$Data."\tIN\tA\t".$Row['czfree_ip']."\n"); 217 216 fputs($File2,$Data."\tIN\tA\t".$Row['IP']."\n"); 218 217 $Data = strtolower($Row['name'].'-ext'); 219 if(strlen($Data) <8) $Data .= "\t";220 fputs($File2, $Data."\tIN\tA\t".$Row['czfree_ip']."\n");221 } 222 223 DB_Query("SELECT network_dns_alias.* FROM `network_dns_alias` JOIN `hosts` ON network_dns_alias.target LIKE hosts.name AND hosts.czfree_ip != ''");224 while($Alias = DB_Row())218 if(strlen($Data) < 8) $Data .= "\t"; 219 fputs($File2, $Data."\tIN\tA\t".$Row['czfree_ip']."\n"); 220 } 221 222 $DbResult = $Database->query("SELECT network_dns_alias.* FROM `network_dns_alias` JOIN `hosts` ON network_dns_alias.target LIKE hosts.name AND hosts.czfree_ip != ''"); 223 while($Alias = $Database->fetch_array()) 225 224 { 226 225 $Data = $Alias['name']; … … 267 266 fputs($File2, $Header); 268 267 269 DB_Select('hosts','*','czfree_ip <> ""');270 while($Row = DB_Row())268 $DbResult = $Database->select('hosts','*','czfree_ip <> ""'); 269 while($Row = $DbResult->fetch_array()) 271 270 { 272 271 $IP = explode('.',$Row['czfree_ip']);
Note:
See TracChangeset
for help on using the changeset viewer.