Ignore:
Timestamp:
Apr 14, 2015, 10:20:16 PM (10 years ago)
Author:
chronos
Message:
  • Removed: Spaces on end of line.
  • Modified: Tabs converted to spaces.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfigRouterOS/Generators/Common.php

    r548 r738  
    66{
    77  global $Database;
    8  
     8
    99  $DbResult = $Database->query('SELECT `Id` FROM `NetworkMark` WHERE `Comment`="'.$Comment.'"');
    1010  if($DbResult->num_rows > 0)
     
    1616    $DbResult = $Database->query('INSERT INTO `NetworkMark` (`Comment`) VALUES ("'.$Comment.'")');
    1717    return($Database->insert_id);
    18   } 
     18  }
    1919}
    2020
     
    2222{
    2323  global $Database;
    24  
     24
    2525  $DbResult = $Database->query('SELECT `Id` FROM `NetworkMangleSubgroup` WHERE `AddressRange`="'.$AddressRange.'"');
    2626  if($DbResult->num_rows > 0)
     
    3232    $DbResult = $Database->query('INSERT INTO `NetworkMangleSubgroup` (`AddressRange`) VALUES ("'.$AddressRange.'")');
    3333    return($Database->insert_id);
    34   } 
     34  }
    3535}
    3636
     
    3838{
    3939  global $Config;
    40  
     40
    4141  $Found = false;
    4242  foreach($Tree['Items'] as $Index => $Node)
     
    5050  if($Found == false)
    5151  {
    52     if($InterSubnets and ($Tree['Address']->Prefix < $Config['MainRouter']['MangleRuleSubgroupMinPrefix']) and 
     52    if($InterSubnets and ($Tree['Address']->Prefix < $Config['MainRouter']['MangleRuleSubgroupMinPrefix']) and
    5353    ($Address->Prefix > ($Tree['Address']->Prefix + 1)))
    5454    {
     
    6161    } else
    6262    {
    63      
     63
    6464      $NewNode = array('Address' => $Address, 'Name' => $Name, 'Items' => array(), 'ForceMark' => $ForceMark);
    65      
     65
    6666      // Should be existed items placed under new node?
    6767      $Found = false;
    6868      foreach($Tree['Items'] as $Index => $Node)
    6969      {
    70         if(($Node['Address']->Address == $NewNode['Address']->Address) and 
    71         ($Node['Address']->Prefix == $NewNode['Address']->Prefix)) $Found = true;       
    72        
     70        if(($Node['Address']->Address == $NewNode['Address']->Address) and
     71        ($Node['Address']->Prefix == $NewNode['Address']->Prefix)) $Found = true;
     72
    7373        //echo($Index.',');
    7474        if($Address->Contain($Node['Address']))
     
    7878        }
    7979      }
    80       if($Found == false) $Tree['Items'][] = $NewNode;     
     80      if($Found == false) $Tree['Items'][] = $NewNode;
    8181    }
    8282  }
     
    8989  {
    9090    ShowSubnetNode($Item, $Indent + 1);
    91   } 
     91  }
    9292}
    9393
Note: See TracChangeset for help on using the changeset viewer.