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/dhcp.php

    r1 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// Generate DHCP server configuration
    75$File = fopen('/etc/dhcpd.conf', 'w');
    8 fputs($File,"# DHCP Configuration file\n".
     6fputs($File, "# DHCP Configuration file\n".
    97"authoritative;\n".
    108'option domain-name "zdechov.net";'."\n".
     
    2220'option netbios-scope "";'."\n".
    2321"server-identifier 192.168.0.1;\n\n");
    24 for($i=0;$i<=$MaxSubnet;$i++)
     22for($i = 0; $i <= $MaxSubnet; $i++)
    2523{
    26   fputs($File,"subnet 192.168.".$i.".0 netmask 255.255.255.0 {\n".
     24  fputs($File, "subnet 192.168.".$i.".0 netmask 255.255.255.0 {\n".
    2725  "  range 192.168.".$i.".128 192.168.".$i.".254;\n".
    2826  "  option broadcast-address 192.168.".$i.".255;\n".
    2927  "  option routers 192.168.".$i.".1;\n");
    30   DB_Select('hosts','*',"IP LIKE '192.168.".$i."%' ORDER BY IP");
    31   while($Row = DB_Row())
     28  $DbResult = $Database->select('hosts', '*', "IP LIKE '192.168.".$i."%' ORDER BY IP");
     29  while($Row = $DbResult->fetch_array())
    3230  {
    3331    $Data = $Row['name'];
    34     if(strlen($Data)<9) $Data .= "\t";
    35     fputs($File,"  host ".$Data."\t{ fixed-address ".$Row['IP'].";\thardware ethernet ".$Row['MAC']."; }\n");
     32    if(strlen($Data) < 9) $Data .= "\t";
     33    fputs($File, "  host ".$Data."\t{ fixed-address ".$Row['IP'].";\thardware ethernet ".$Row['MAC']."; }\n");
    3634  }
    3735 
    38   fputs($File,"}\n\n");
     36  fputs($File, "}\n\n");
    3937}
    4038fclose($File);
Note: See TracChangeset for help on using the changeset viewer.