Changeset 211 for trunk


Ignore:
Timestamp:
May 10, 2009, 11:35:41 AM (16 years ago)
Author:
george
Message:
  • Upraveno: Dynamická velikost mapy.
  • Upraveno: Volba zobrazení prvků mapy.
  • Opraveno: Skript pro generování DNS záznamů opraven pro podporu struktury nových tabulek.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        22php_script_error.log
        33statistic
        4 
         4webis
  • trunk/index.php

    r210 r211  
    4444    ),
    4545    'citizen' => array('Stránky občanů',
    46        array('Štaněk Tatra team', 'http://www.stanek-tatra.cz/', 'www_stanek-tatra_cz.ico'),
     46       array('Staněk Tatra team', 'http://www.stanek-tatra.cz/', 'www_stanek-tatra_cz.ico'),
    4747       array('Zděchov.eu', 'http://www.zdechov.eu/', 'obec_zdechov.ico'),
    4848     ),
  • trunk/map/index.php

    r209 r211  
    1717    $Output .= '<script type="text/javascript">
    1818
     19    var map;
     20
    1921    function initialize()
    2022    {
    2123      if (GBrowserIsCompatible())
    2224      {
    23         var map = new GMap2(document.getElementById("map_canvas"));
     25        map = new GMap2(document.getElementById("map_canvas"));
    2426        map.setMapType(G_SATELLITE_MAP);
    2527        map.setCenter(new GLatLng(49.260422, 18.081179), 15);
    2628        map.setUIToDefault();
     29        map.addControl(new GOverviewMapControl(new GSize(128, 96)));
     30       
    2731
    2832// Create our "tiny" marker icon
     
    3741// Set up our GMarkerOptions object literal
    3842markerOptions = { icon:tinyIcon };';
    39 
    40 
    41     $DbResult = $this->Database->query('SELECT * FROM NetworkDevice');
    42     while($Device = $DbResult->fetch_assoc())
    43     {
    44       $Output .= 'map.addOverlay(new GMarker(new GLatLng('.$Device['PositionLatitude'].', '.$Device['PositionLongitude'].'), markerOptions)); ';
     43   
     44    $Output .= '   
     45       }     
    4546    }
    4647   
     48function toggleLabel(id)
     49{
     50        var ele = document.getElementById(id);
     51        ele.checked = !ele.checked;
     52        ele.onclick( );
     53}
     54
     55    function UpdateNetworkLinks()
     56    {
     57            if ((document.getElementById("NetworkLinks")).checked == true)
     58      {
     59                    NetworkLinks = [';
    4760    $DbResult = $this->Database->query('SELECT * FROM NetworkLink WHERE Interface1 <> 0 AND Interface2 <> 0');
    4861    while($Link = $DbResult->fetch_assoc())
     
    5467        $Device1 = $DbResult2->fetch_assoc();
    5568        $Device2 = $DbResult3->fetch_assoc();
    56         $Output .= 'map.addOverlay(new GPolyline([new GLatLng('.$Device1['PositionLatitude'].', '.$Device1['PositionLongitude'].'),new GLatLng('.$Device2['PositionLatitude'].', '.$Device2['PositionLongitude'].')], "#FFFFFF", 3, 0.8)); ';
     69        $Output .= 'new GPolyline([new GLatLng('.$Device1['PositionLatitude'].', '.$Device1['PositionLongitude'].'),new GLatLng('.$Device2['PositionLatitude'].', '.$Device2['PositionLongitude'].')], "#4F4FBF", 3, 0.8), ';
    5770      }
    5871    }
    59     $Output .= '   
    60        }     
     72    $Output .= '];
     73                for (var i in NetworkLinks)
     74                {
     75                        map.addOverlay(NetworkLinks[i]);
     76                }
     77
     78         } else { //checkbox turned off
     79                for (var i in NetworkLinks)
     80    {
     81                        map.removeOverlay(NetworkLinks[i]);
     82                        NetworkLinks[i] = null;
     83                }
     84        }
     85}
     86
     87function toggleLabel(id)
     88{
     89        var ele = document.getElementById(id);
     90        ele.checked = !ele.checked;
     91        ele.onclick( );
     92}
     93
     94    function UpdateNetworkDevices()
     95    {
     96            if ((document.getElementById("NetworkDevices")).checked == true)
     97      {
     98                    NetworkDevices = [';
     99
     100    $DbResult = $this->Database->query('SELECT * FROM NetworkDevice');
     101    while($Device = $DbResult->fetch_assoc())
     102    {
     103      $Output .= 'new GMarker(new GLatLng('.$Device['PositionLatitude'].', '.$Device['PositionLongitude'].'), markerOptions), ';
    61104    }
     105    $Output .= '];
     106                for (var i in NetworkDevices)
     107                {
     108                        map.addOverlay(NetworkDevices[i]);
     109                }
     110
     111         } else { //checkbox turned off
     112                for (var i in NetworkDevices)
     113    {
     114                        map.removeOverlay(NetworkDevices[i]);
     115                        NetworkDevices[i] = null;
     116                }
     117        }
     118}
     119
    62120    </script>';
    63     $Output .= '<div align="center">
    64     <div id="map_canvas" style="width: 800px; height: 500px;"></div>
    65     <div id="message"></div>
    66     <div id="message2"></div>
    67     </div>';
     121    $Output .= '<table style="margin-left: auto; margin-right: auto; width: 100%; height: 80%;">
     122                  <tr>
     123                    <td style="width: 80%; height: 100%;">
     124    <div id="map_canvas" style="width: 100%; height: 100%;"></div></td>
     125    <td style="width: 20%">
     126    <form>
     127    <input type="checkbox" id="NetworkLinks" onClick="UpdateNetworkLinks();" >
     128       <a href="" onClick="toggleLabel(\'NetworkLinks\');return false;">Ukázat spoje</a>
     129       </input><br />
     130    <input type="checkbox" id="NetworkDevices" onClick="UpdateNetworkDevices();" >
     131       <a href="" onClick="toggleLabel(\'NetworkDevices\');return false;">Ukázat zařízení</a>
     132       </input>
     133    </form></td>
     134                  </tr>
     135                </table>';
    68136    return($Output);
    69137  }
  • trunk/style.css

    r203 r211  
    1 body
    2 {
     1html,body
     2{
     3  height: 100%;
    34  font-family: sans-serif;
    45}
  • trunk/system/generators/dns.php

    r201 r211  
    11<?php
     2
    23if(isset($_SERVER['REMOTE_ADDR'])) die();
    34include_once('../../global.php');
    45
     6$BaseDomain = 'zdechov.net';
    57$Serial = date('Ymds', time());
    68$MinimumTime = 7200;
     
    1618
    1719// Generate DNS records
    18 $File = fopen($BaseDir.'internal/zdechov.net.zone', 'w');
    19 fputs($File,'$ORIGIN zdechov.net.'."\n".
     20$File = fopen($BaseDir.'internal/'.$BaseDomain.'.zone', 'w');
     21fputs($File,'$ORIGIN '.$BaseDomain.'.'."\n".
    2022'$TTL 86400'."\n".
    21 "zdechov.net.\tIN\tSOA\t".$NameServers[0].".zdechov.net.\troot.zdechov.net.     (\n".
     23$BaseDomain.".\tIN\tSOA\t".$NameServers[0].".".$BaseDomain.".\troot.".$BaseDomain.".    (\n".
    2224"\t\t\t".$Serial."\t; serial\n".
    2325"\t\t\t".$RefreshTime."\t; refresh\n".
     
    2628"\t\t\t".$MinimumTime."\t; minimum\n".
    2729"\t\t\t)\n".
    28 "\t\tIN\tNS\t".$NameServers[0].".zdechov.net.\n".
    29 "\t\tIN\tNS\t".$NameServers[1].".zdechov.net.\n".
     30"\t\tIN\tNS\t".$NameServers[0].".".$BaseDomain.".\n".
     31"\t\tIN\tNS\t".$NameServers[1].".".$BaseDomain.".\n".
    3032"\t\t\tTXT\t".'"community network ZdechovNET"'."\n".
    3133// "\t\tIN\tA\t192.168.0.1\n".
    32 "\t\t\tMX\t10 ".$MailServer.".zdechov.net.\n");
    33 
    34 $DbResult = $Database->select('hosts','*',' block < 2 AND IP <> ""');
    35 while($Row = $DbResult->fetch_array())
    36 {
    37   $Data = strtolower($Row['name']);
    38   if(strlen($Data) < 8) $Data .= "\t";
    39   fputs($File, $Data."\tIN\tA\t".$Row['IP']."\n");
     34"\t\t\tMX\t10 ".$MailServer.".".$BaseDomain.".\n");
     35
     36$DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetwordInterface.Device WHERE NetworkInterface.LocalIP <> ""');
     37while($Interface = $DbResult->fetch_assoc())
     38{
     39  $Name = $Interface['DeviceName'];
     40  if($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];
     41  $Name = strtolower($Name);
     42  if(strlen($Name) < 8) $Name .= "\t";
     43  fputs($File, $Name."\tIN\tA\t".$Interface['LocalIP']."\n");
    4044}
    4145
    4246// External records in internal server
    43 $DbResult = $Database->select('hosts','*','external_ip<>""');
    44 while($Row = $DbResult->fetch_array())
    45 {
    46   $Data = strtolower($Row['name']).'-ext';
    47   if(strlen($Data) < 8) $Data .= "\t";
    48   fputs($File,$Data."\tIN\tA\t".$Row['external_ip']."\n");
     47$DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetwordInterface.Device WHERE NetworkInterface.ExternalIP <> ""');
     48while($Interface = $DbResult->fetch_assoc())
     49{
     50  $Name = $Interface['DeviceName'];
     51  if($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];
     52  $Name = strtolower($Name.'-ext');
     53  if(strlen($Name) < 8) $Name .= "\t";
     54  fputs($File, $Name."\tIN\tA\t".$Interface['ExternalIP']."\n");
    4955}
    5056
    5157$DbResult = $Database->select('NetworkDomainAlias', '*');
    52 while($Alias = $DbResult->fetch_array())
     58while($Alias = $DbResult->fetch_assoc())
    5359{
    5460  $Data = strtolower($Alias['Name']);
     
    6773  fputs($File,
    6874  '$TTL 86400'."\n".
    69   "@\tIN\tSOA\t".$NameServers[0].".zdechov.net.\troot.zdechov.net.      (\n".
    70   "\t\t\t\t".$Serial."\t; serial\n".
    71   "\t\t\t\t".$RefreshTime."\t; refresh\n".
    72   "\t\t\t\t".$RetryTime."\t; retry\n".
    73   "\t\t\t\t".$ExpireTime."\t; expire\n".
    74   "\t\t\t\t".$MinimumTime."\t; minimum\n".
    75   "\t\t\t\t)\n".
    76   "@\tIN\tNS\t".$NameServers[0].".zdechov.net.\n".
    77   "\tIN\tNS\t".$NameServers[1].".zdechov.net.\n\n");
    78   $DbResult = $Database->select('hosts','*','IP LIKE "'.$Network.'%"');
    79   while($Row = $DbResult->fetch_array())
     75  "@\tIN\tSOA\t".$NameServers[0].".".$BaseDomain.".\troot.".$BaseDomain.".      (\n".
     76  "\t\t\t\t".$Serial."\t; serial\n".
     77  "\t\t\t\t".$RefreshTime."\t; refresh\n".
     78  "\t\t\t\t".$RetryTime."\t; retry\n".
     79  "\t\t\t\t".$ExpireTime."\t; expire\n".
     80  "\t\t\t\t".$MinimumTime."\t; minimum\n".
     81  "\t\t\t\t)\n".
     82  "@\tIN\tNS\t".$NameServers[0].".".$BaseDomain.".\n".
     83  "\tIN\tNS\t".$NameServers[1].".".$BaseDomain.".\n\n");
     84  $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.LocalIP LIKE "'.$Network.'%"');
     85  while($Interface = $DbResult->fetch_assoc())
    8086  {
    81     $IP = explode('.',$Row['IP']);
    82     fputs($File,$IP[3]."\tIN\tPTR\t".strtolower($Row['name']).".zdechov.net.\n");
     87    $Name = $Interface['DeviceName'];
     88    if($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];
     89    $Name = strtolower($Name.'-ext');
     90    $IP = explode('.', $Interface['LocalIP']);
     91    fputs($File, $IP[3]."\tIN\tPTR\t".strtolower($Name).".zdechov.net.\n");
    8392  }
    8493  fclose($File);
     
    93102  fputs($File,
    94103  '$TTL 86400'."\n".
    95   "@\tIN\tSOA\t".$NameServers[0].".zdechov.net.\troot.zdechov.net.      (\n".
    96   "\t\t\t\t".$Serial."\t; serial\n".
    97   "\t\t\t\t".$RefreshTime."\t; refresh\n".
    98   "\t\t\t\t".$RetryTime."\t; retry\n".
    99   "\t\t\t\t".$ExpireTime."\t; expire\n".
    100   "\t\t\t\t".$MinimumTime."\t; minimum\n".
    101   "\t\t\t\t)\n".
    102   "@\tIN\tNS\t".$NameServers[0].".zdechov.net.\n".
    103   "\tIN\tNS\t".$NameServers[1].".zdechov.net.\n\n");
    104   $DbResult = $Database->select('hosts','*','external_ip LIKE "'.$Network.'.%"');
    105   while($Row = $DbResult->fetch_array())
     104  "@\tIN\tSOA\t".$NameServers[0].".".$BaseDomain.".\troot.".$BaseDomain.".      (\n".
     105  "\t\t\t\t".$Serial."\t; serial\n".
     106  "\t\t\t\t".$RefreshTime."\t; refresh\n".
     107  "\t\t\t\t".$RetryTime."\t; retry\n".
     108  "\t\t\t\t".$ExpireTime."\t; expire\n".
     109  "\t\t\t\t".$MinimumTime."\t; minimum\n".
     110  "\t\t\t\t)\n".
     111  "@\tIN\tNS\t".$NameServers[0].".".$BaseDomain.".\n".
     112  "\tIN\tNS\t".$NameServers[1].".".$BaseDomain.".\n\n");
     113  $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.ExternalIP LIKE "'.$Network.'%"');
     114  while($Interface = $DbResult->fetch_assoc())
    106115  {
    107     $IP = explode('.',$Row['external_ip']);
    108     fputs($File, $IP[3]."\tIN\tPTR\t".strtolower($Row['name'])."-ext.zdechov.net.\n");
     116    $Name = $Interface['DeviceName'];
     117    if($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];
     118    $Name = strtolower($Name.'-ext');
     119    $IP = explode('.',$Interafce['ExternalIP']);
     120    fputs($File, $IP[3]."\tIN\tPTR\t".strtolower($Name])."-ext.".$BaseDomain.".\n");
    109121  }
    110122  fclose($File);
     
    114126
    115127// Generate DNS records
    116 $File = fopen($BaseDir.'external/zdechov.net.zone', 'w');
    117 $Header = '$ORIGIN zdechov.net.'."\n".
     128$File = fopen($BaseDir.'external/'.$BaseDomain.'.zone', 'w');
     129$Header = '$ORIGIN '.$BaseDomain.'.'."\n".
    118130'$TTL 86400'."\n".
    119 "zdechov.net.\tIN\tSOA\t".$NameServers[0].".zdechov.net.\troot.zdechov.net.     (\t\n".
     131$BaseDomain.".\tIN\tSOA\t".$NameServers[0].".".$BaseDomain.".\troot.".$BaseDomain.".    (\t\n".
    120132"\t\t\t".$Serial."\t; serial\n".
    121133"\t\t\t".$RefreshTime."\t; refresh\n".
     
    125137"\t\t\t)\n".
    126138"\t\t\tTXT\t".'"community network ZdechovNET"'."\n".
    127 "\t\tIN\tNS\t".$NameServers[0].".zdechov.net.\n".
    128 "\t\tIN\tNS\t".$NameServers[1].".zdechov.net.\n".
     139"\t\tIN\tNS\t".$NameServers[0].".".$BaseDomain.".\n".
     140"\t\tIN\tNS\t".$NameServers[1].".".$BaseDomain.".\n".
    129141"\t\tIN\tNS\tplandsfeld.avonet.cz.\n";
    130142// "\t\tIN\tA\t81.2.194.142\n".
    131 $Header .= "\t\t\tMX\t10 ".$MailServer.".zdechov.net.\n".
     143$Header .= "\t\t\tMX\t10 ".$MailServer.".".$BaseDomain.".\n".
    132144"; SPF\n".
    133145"zdechov.net.\tIN\tTXT\t\"v=spf1 mx -all\"\n".
     
    139151fputs($File, $Header);
    140152
    141 $DbResult = $Database->select('hosts','*','external_ip<>""');
    142 while($Row = $DbResult->fetch_array())
    143 {
    144   $Data = strtolower($Row['name']);
    145   if(strlen($Data) < 8) $Data .= "\t";
    146   fputs($File,$Data."\tIN\tA\t".$Row['external_ip']."\n");
    147 }
    148 
    149 $DbResult = $Database->query('SELECT NetworkDomainAlias.* FROM  `NetworkDomainAlias` JOIN  `hosts`  ON NetworkDomainAlias.Target LIKE hosts.name AND hosts.external_ip != ""');
    150 while($Alias = $DbResult->fetch_array())
     153$DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.ExternalIP != ""');
     154while($Interface = $DbResult->fetch_assoc())
     155{
     156  $Name = $Interface['DeviceName'];
     157  if($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];
     158  $Name = strtolower($Name);
     159  if(strlen($Name) < 8) $Name .= "\t";
     160  fputs($File, $Name."\tIN\tA\t".$Interface['ExternalIP']."\n");
     161}
     162
     163$DbResult = $Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias`');
     164// JOIN `NetworkDevice` ON NetworkDomainAlias.Target LIKE NetworkDevice.Name AND NetworkInterface.ExternalIP != ""');
     165while($Alias = $DbResult->fetch_assoc())
    151166{
    152167  $Data = strtolower($Alias['Name']);
     
    165180  fputs($File,
    166181  '$TTL 86400'."\n".
    167   "@\tIN\tSOA\t".$NameServers[0].".zdechov.net.\troot.zdechov.net.      (\n".
    168   "\t\t\t\t".$Serial."\t; serial\n".
    169   "\t\t\t\t".$RefreshTime."\t; refresh\n".
    170   "\t\t\t\t".$RetryTime."\t; retry\n".
    171   "\t\t\t\t".$ExpireTime."\t; expire\n".
    172   "\t\t\t\t".$MinimumTime."\t; minimum\n".
    173   "\t\t\t\t)\n".
    174   "@\tIN\tNS\t".$NameServers[0].".zdechov.net.\n\n".
     182  "@\tIN\tSOA\t".$NameServers[0].".".$BaseDomain.".\troot.".$BaseDomain.".      (\n".
     183  "\t\t\t\t".$Serial."\t; serial\n".
     184  "\t\t\t\t".$RefreshTime."\t; refresh\n".
     185  "\t\t\t\t".$RetryTime."\t; retry\n".
     186  "\t\t\t\t".$ExpireTime."\t; expire\n".
     187  "\t\t\t\t".$MinimumTime."\t; minimum\n".
     188  "\t\t\t\t)\n".
     189  "@\tIN\tNS\t".$NameServers[0].".".$BaseDomain.".\n\n".
    175190  "\t\t\tNS\tplandsfeld.avonet.cz.\n".
    176   "\t\t\tNS\t".$NameServers[1].".zdechov.net.\n");
    177 
    178   $DbResult = $Database->select('hosts','*','external_ip LIKE "'.$Network.'.%"');
    179   while($Row = $DbResult->fetch_array())
     191  "\t\t\tNS\t".$NameServers[1].".".$BaseDomain.".\n");
     192
     193  $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetwordInterface.Device WHERE NetworkInterface.ExternalIP LIKE "'.$Network.'.%"');
     194  while($Interface = $DbResult->fetch_assoc())
    180195  {
    181     $IP = explode('.',$Row['external_ip']);
    182     fputs($File, $IP[3]."\tIN\tPTR\t".strtolower($Row['name']).".zdechov.net.\n");
     196    $Name = $Interface['DeviceName'];
     197    if($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];
     198    $Name = strtolower($Name);
     199    if(strlen($Name) < 8) $Name .= "\t";
     200    $IP = explode('.', $Interface['ExternalIP']);
     201    fputs($File, $IP[3]."\tIN\tPTR\t".strtolower($Interface['Name']).".".$BaseDomain.".\n");
    183202  }
     203
    184204  fclose($File);
    185205}
     
    225245fputs($File2, $Header);
    226246
    227 $DbResult = $Database->select('hosts','*','czfree_ip<>""');
    228 while($Row = $DbResult->fetch_array())
    229 {
    230   $Data = strtolower($Row['name']);
    231   if(strlen($Data) < 8) $Data .= "\t";
    232   fputs($File,$Data."\tIN\tA\t".$Row['czfree_ip']."\n");
    233   fputs($File2,$Data."\tIN\tA\t".$Row['IP']."\n");
    234   $Data = strtolower($Row['name'].'-ext');
    235   if(strlen($Data) < 8) $Data .= "\t";
    236   fputs($File2, $Data."\tIN\tA\t".$Row['czfree_ip']."\n");
     247$DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.CZFreeIP != ""');
     248while($Interface = $DbResult->fetch_assoc())
     249{
     250  $Name = $Interface['DeviceName'];
     251  if($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];
     252  $Name = strtolower($Name);
     253  if(strlen($Name) < 8) $Name .= "\t";
     254  fputs($File, $Name."\tIN\tA\t".$Interface['CZFreeIP']."\n");
     255  fputs($File2, $Name."\tIN\tA\t".$Interface['LocalIP']."\n");
     256  $Name .= '-czfree';
     257  fputs($File2, $Name."\tIN\tA\t".$Interface['CZFreeIP']."\n");
    237258}
    238259
    239260$DbResult = $Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias` JOIN `hosts`  ON NetworkDomainAlias.Target LIKE hosts.name AND hosts.czfree_ip != ""');
    240 while($Alias = $DbResult->fetch_array())
     261while($Alias = $DbResult->fetch_assoc())
    241262{
    242263  $Data = $Alias['Name'];
     
    282303  fputs($File2, $Header);
    283304
    284   $DbResult = $Database->select('hosts','*','czfree_ip <> ""');
    285   while($Row = $DbResult->fetch_array())
     305  $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetwordInterface.Device WHERE NetworkInterface.CZFreeIP LIKE "'.$Network.'.%"');
     306  while($Interface = $DbResult->fetch_assoc())
    286307  {
    287     $IP = explode('.',$Row['czfree_ip']);
    288     fputs($File, $IP[3]."\tIN\tPTR\t".strtolower($Row['name']).".".$Domain.".\n");
    289     fputs($File2, $IP[3]."\tIN\tPTR\t".strtolower($Row['name']).'-ext'.".".$Domain.".\n");
     308    $Name = $Interface['DeviceName'];
     309    if($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];
     310    $Name = strtolower($Name);
     311    if(strlen($Name) < 8) $Name .= "\t";
     312    $IP = explode('.', $Interface['CZFreeIP']);
     313    fputs($File, $IP[3]."\tIN\tPTR\t".strtolower($Interface['Name']).".".$Domain.".\n");
     314    fputs($File2, $IP[3]."\tIN\tPTR\t".strtolower($Interface['Name'].'-czfree').".".$Domain.".\n");
    290315  }
     316
    291317  fclose($File);
    292318  fclose($File2);
Note: See TracChangeset for help on using the changeset viewer.