Changeset 275 for trunk/system


Ignore:
Timestamp:
Jan 24, 2010, 8:05:10 AM (15 years ago)
Author:
george
Message:
  • Upraveno: Nově rozšířená tabulka dokladových řad pro podporu oddělených účetních roků.
  • Opraveno: Nové volání funkcí pro IPv4 ze skriptů generování nastavení sítě.
Location:
trunk/system/generators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/system/generators/firewall_nat.php

    r272 r275  
    3333  $DbResult2 = $Database->select('NetworkSubnet', '*', 'Member='.$Member['Id']);
    3434  while($Subnet = $DbResult2->fetch_assoc())
    35   {
     35  {   
    3636    $Subnet['Name'] = RouterOSIdent('subnet-'.$Subnet['Name']);
    3737    echo($Subnet['Name'].'('.$Subnet['AddressRange'].'/'.$Subnet['Mask'].'), ');
    38     $Range = CIDRToAddressRange($Subnet['ExtAddressRange'], $Subnet['ExtMask']);
     38    $NewAddress = new NetworkAddressIPv4();
     39    $NewAddress->AddressFromString($Subnet['ExtAddressRange']);
     40    $NewAddress->Prefix = $Subnet['ExtMask'];
     41    $Range = $NewAddress->GetRange();
    3942    if($Subnet['ExtMask'] != 32) $Range = $Range['From'].'-'.$Range['To'];
    4043      else $Range = $Range['From'];
     
    4346    $Items[] = array('chain' => 'srcnat', 'src-address' => $Src, 'out-interface' => $InetInterface, 'action' => 'src-nat', 'to-addresses' => $Range, 'comment' => $Subnet['Name'].'-out');
    4447   
    45     $Range = CIDRToAddressRange($Subnet['AddressRange'], $Subnet['Mask']);
     48    $NewAddress = new NetworkAddressIPv4();
     49    $NewAddress->AddressFromString($Subnet['AddressRange']);
     50    $NewAddress->Prefix = $Subnet['Mask'];
     51    $Range = $NewAddress->GetRange();
    4652    if($Subnet['Mask'] != 32) $Range = $Range['From'].'-'.$Range['To'];
    4753      else $Range = $Range['From'];
  • trunk/system/generators/netwatch_import.php

    r273 r275  
    1717  foreach($List as $Properties)
    1818  {
    19     if(IsAddressInSubnet($Properties['host'], $Subnet['AddressRange'], $Subnet['Mask']))
     19    $NewAddress = new NetworkAddressIPv4();
     20    $NewAddress->AddressFromString($Subnet['AddressRange']);
     21    $NewAddress->Prefix = $Subnet['Mask'];
     22    if($NewAddress->Contain($Properties['host']))
    2023    {
    2124      //echo($Properties['host'].', ');
Note: See TracChangeset for help on using the changeset viewer.