Ignore:
Timestamp:
Jan 31, 2008, 8:38:47 PM (17 years ago)
Author:
george
Message:

Upraveno: Přepsán přístup k databázi přes třídu mysqli v systémové složce.
Odstraněno: Staré verze souborů a staré nepoužité soubory.

Location:
system
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • system

    • Property svn:ignore set to
      nohup.out
  • 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
     2include_once('../../html/global.php');
    53
    64//$Serial = '2007070601';  // Should be changed on every change
     
    2826"\t\t\tMX\t10 mail.zdechov.net.\n");
    2927
    30 DB_Select('hosts','*',' block < 2 AND IP <> ""');
    31 while($Row = DB_Row())
     28$DbResult = $Database->select('hosts','*',' block < 2 AND IP <> ""');
     29while($Row = $DbResult->fetch_array())
    3230{
    3331  $Data = strtolower($Row['name']);
     
    3735
    3836// External records in internal server
    39 DB_Select('hosts','*','external_ip<>""');
    40 while($Row = DB_Row())
     37$DbResult = $Database->select('hosts','*','external_ip<>""');
     38while($Row = $DbResult->fetch_array())
    4139{
    4240  $Data = strtolower($Row['name']).'-ext';
     
    4543}
    4644
    47 DB_Select('network_dns_alias', '*');
    48 while($Alias = DB_Row())
     45$DbResult = $Database->select('network_dns_alias', '*');
     46while($Alias = $DbResult->fetch_array())
    4947{
    5048  $Data = strtolower($Alias['name']);
     
    7169  "\t\t\t\t)\n".
    7270  "@\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())
    7573  {
    7674    $IP = explode('.',$Row['IP']);
     
    9694  "\t\t\t\t)\n".
    9795  "@\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())
    10098  {
    10199    $IP = explode('.',$Row['external_ip']);
     
    126124fputs($File, $Header);
    127125
    128 DB_Select('hosts','*','external_ip<>""');
    129 while($Row = DB_Row())
     126$DbResult = $Database->select('hosts','*','external_ip<>""');
     127while($Row = $DbResult->fetch_array())
    130128{
    131129  $Data = strtolower($Row['name']);
     
    134132}
    135133
    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 != ''");
     135while($Alias = $DbResult->fetch_array())
    138136{
    139137  $Data = strtolower($Alias['name']);
     
    161159  "@\tIN\tNS\t".$ExternalServerName.".\n\n".
    162160  "\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())
    165164  {
    166165    $IP = explode('.',$Row['external_ip']);
     
    209208fputs($File2, $Header);
    210209
    211 DB_Select('hosts','*','czfree_ip<>""');
    212 while($Row = DB_Row())
     210$Database->select('hosts','*','czfree_ip<>""');
     211while($Row = $Database->fetch_array())
    213212{
    214213  $Data = strtolower($Row['name']);
    215   if(strlen($Data)<8) $Data .= "\t";
     214  if(strlen($Data) < 8) $Data .= "\t";
    216215  fputs($File,$Data."\tIN\tA\t".$Row['czfree_ip']."\n");
    217216  fputs($File2,$Data."\tIN\tA\t".$Row['IP']."\n");
    218217  $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 != ''");
     223while($Alias = $Database->fetch_array())
    225224{
    226225  $Data = $Alias['name'];
     
    267266  fputs($File2, $Header);
    268267
    269   DB_Select('hosts','*','czfree_ip <> ""');
    270   while($Row = DB_Row())
     268  $DbResult = $Database->select('hosts','*','czfree_ip <> ""');
     269  while($Row = $DbResult->fetch_array())
    271270  {
    272271    $IP = explode('.',$Row['czfree_ip']);
Note: See TracChangeset for help on using the changeset viewer.