Changeset 738 for trunk/Modules/NetworkConfigRouterOS/Generators/Common.php
- Timestamp:
- Apr 14, 2015, 10:20:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Generators/Common.php
r548 r738 6 6 { 7 7 global $Database; 8 8 9 9 $DbResult = $Database->query('SELECT `Id` FROM `NetworkMark` WHERE `Comment`="'.$Comment.'"'); 10 10 if($DbResult->num_rows > 0) … … 16 16 $DbResult = $Database->query('INSERT INTO `NetworkMark` (`Comment`) VALUES ("'.$Comment.'")'); 17 17 return($Database->insert_id); 18 } 18 } 19 19 } 20 20 … … 22 22 { 23 23 global $Database; 24 24 25 25 $DbResult = $Database->query('SELECT `Id` FROM `NetworkMangleSubgroup` WHERE `AddressRange`="'.$AddressRange.'"'); 26 26 if($DbResult->num_rows > 0) … … 32 32 $DbResult = $Database->query('INSERT INTO `NetworkMangleSubgroup` (`AddressRange`) VALUES ("'.$AddressRange.'")'); 33 33 return($Database->insert_id); 34 } 34 } 35 35 } 36 36 … … 38 38 { 39 39 global $Config; 40 40 41 41 $Found = false; 42 42 foreach($Tree['Items'] as $Index => $Node) … … 50 50 if($Found == false) 51 51 { 52 if($InterSubnets and ($Tree['Address']->Prefix < $Config['MainRouter']['MangleRuleSubgroupMinPrefix']) and 52 if($InterSubnets and ($Tree['Address']->Prefix < $Config['MainRouter']['MangleRuleSubgroupMinPrefix']) and 53 53 ($Address->Prefix > ($Tree['Address']->Prefix + 1))) 54 54 { … … 61 61 } else 62 62 { 63 63 64 64 $NewNode = array('Address' => $Address, 'Name' => $Name, 'Items' => array(), 'ForceMark' => $ForceMark); 65 65 66 66 // Should be existed items placed under new node? 67 67 $Found = false; 68 68 foreach($Tree['Items'] as $Index => $Node) 69 69 { 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 73 73 //echo($Index.','); 74 74 if($Address->Contain($Node['Address'])) … … 78 78 } 79 79 } 80 if($Found == false) $Tree['Items'][] = $NewNode; 80 if($Found == false) $Tree['Items'][] = $NewNode; 81 81 } 82 82 } … … 89 89 { 90 90 ShowSubnetNode($Item, $Indent + 1); 91 } 91 } 92 92 } 93 93
Note:
See TracChangeset
for help on using the changeset viewer.