- Timestamp:
- Dec 11, 2008, 9:19:49 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
system/generators/routerboard.php
r125 r126 41 41 } 42 42 43 function GetList($Command, $Properties )43 function GetList($Command, $Properties, $Conditions = '') 44 44 { 45 45 $PropertyList = '"'; … … 49 49 } 50 50 $PropertyList = substr($PropertyList, 0, -3); 51 $Result = $this->Execute($Command.' {:foreach i in=[find] do={:put ('.$PropertyList.')}}'); 51 if(is_array($Conditions)) 52 { 53 $ConditionList = ''; 54 foreach($Conditions as $Name => $Value) 55 $ConditionList .= $Name.'='.$Value.' '; 56 } else $ConditionList = $Conditions; 57 $Result = $this->Execute($Command.' {:foreach i in=[find '.$ConditionList.'] do={:put ('.$PropertyList.')}}'); 52 58 $List = array(); 53 59 foreach($Result as $ResultLine) … … 70 76 } 71 77 72 function GetFirewallFilterList( )78 function GetFirewallFilterList($Conditions = '') 73 79 { 74 return($this->GetList('/ip firewall filter', array('src-address', 'dst-address', 'bytes')));80 return($this->GetList('/ip firewall nat', array('src-address', 'dst-address', 'bytes'), $Conditions)); 75 81 } 76 82 77 function GetDHCPServerLeasesList( )83 function GetDHCPServerLeasesList($Conditions = '') 78 84 { 79 return($this->GetList('/ip dhcp-server lease', array('address', 'active-address', 'comment', 'lease-time', 'status', 'host-name') ));85 return($this->GetList('/ip dhcp-server lease', array('address', 'active-address', 'comment', 'lease-time', 'status', 'host-name'), $Conditions)); 80 86 } 81 87 }
Note:
See TracChangeset
for help on using the changeset viewer.