Changeset 873 for trunk/Modules/NetworkConfigRouterOS/Routerboard2.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Routerboard2.php
r738 r873 13 13 function Execute($Commands) 14 14 { 15 if (is_array($Commands)) $Commands = implode(';', $Commands);16 return (parent::Execute($Commands));15 if (is_array($Commands)) $Commands = implode(';', $Commands); 16 return (parent::Execute($Commands)); 17 17 } 18 18 … … 22 22 array_pop($Result); 23 23 $List = array(); 24 foreach ($Result as $ResultLine)24 foreach ($Result as $ResultLine) 25 25 { 26 26 $ResultLineParts = explode(' ', trim($ResultLine)); 27 if ($ResultLineParts[1]{0} == '"') $ResultLineParts[1] = substr($ResultLineParts[1], 1, -1); // Remove quotes27 if ($ResultLineParts[1]{0} == '"') $ResultLineParts[1] = substr($ResultLineParts[1], 1, -1); // Remove quotes 28 28 $List[substr($ResultLineParts[0], 0, -1)] = $ResultLineParts[1]; 29 29 } 30 return ($List);30 return ($List); 31 31 } 32 32 … … 34 34 { 35 35 $PropertyList = '"'; 36 foreach ($Properties as $Property)36 foreach ($Properties as $Property) 37 37 { 38 38 $PropertyList .= $Property.'=".[get $i '.$Property.']." '; … … 41 41 $Result = $this->Execute($Command.' {:foreach i in=[find] do={:put ('.$PropertyList.')}}'); 42 42 $List = array(); 43 foreach ($Result as $ResultLine)43 foreach ($Result as $ResultLine) 44 44 { 45 45 $ResultLineParts = explode(' ', $ResultLine); 46 46 $ListItem = array(); 47 foreach ($ResultLineParts as $ResultLinePart)47 foreach ($ResultLineParts as $ResultLinePart) 48 48 { 49 49 $Value = explode('=', $ResultLinePart); … … 52 52 $List[] = $ListItem; 53 53 } 54 return ($List);54 return ($List); 55 55 } 56 56 57 57 function GetSystemResource() 58 58 { 59 return ($this->GetItem('/system resource print'));59 return ($this->GetItem('/system resource print')); 60 60 } 61 61 62 62 function GetFirewallFilterList() 63 63 { 64 return ($this->GetList('/ip firewall nat', array('src-address', 'dst-address', 'bytes')));64 return ($this->GetList('/ip firewall nat', array('src-address', 'dst-address', 'bytes'))); 65 65 } 66 66 67 67 function GetDHCPServerLeasesList() 68 68 { 69 return ($this->GetList('/ip dhcp-server lease', array('address', 'active-address', 'comment', 'lease-time', 'status', 'host-name')));69 return ($this->GetList('/ip dhcp-server lease', array('address', 'active-address', 'comment', 'lease-time', 'status', 'host-name'))); 70 70 } 71 71 }
Note:
See TracChangeset
for help on using the changeset viewer.