Changeset 213 for trunk/system/generators/traffic_shaping_routerboard.php
- Timestamp:
- May 10, 2009, 12:30:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/traffic_shaping_routerboard.php
r208 r213 75 75 $Commands[] = ' /queue tree add name='.$Member['Name'].'-in limit-at='.$SpeedOut.' max-limit='.$UserMaxSpeedOut.' parent=main-in queue=wireless-default'; 76 76 77 $DbResult2 = $Database->select(' hosts', 'COUNT(*)', '(block = 0) AND (MAC != "") AND (user='.$Member['Id'].')');78 $Row = $DbResult2->fetch_ array();77 $DbResult2 = $Database->select('NetworkDevice', 'COUNT(*)', 'Member='.$Member['Id']); 78 $Row = $DbResult2->fetch_row(); 79 79 $HostCount = $Row[0]; 80 80 if($HostCount > 0) … … 91 91 while($Device = $DbResult2->fetch_assoc()) 92 92 { 93 $DbResult3 = $Database->select('NetworkInterface', '*', 'Device = '.$Device['Id'] );93 $DbResult3 = $Database->select('NetworkInterface', '*', 'Device = '.$Device['Id'].' AND LocalIP != ""'); 94 94 while($Interface = $DbResult3->fetch_assoc()) 95 95 { 96 $Name = $Device['Name'].'-'.$Interface['Name']; 96 $Name = $Device['Name']; 97 if($Interface['Name'] != '') $Name .= '-'.$Interface['Name']; 97 98 $Name = RouterOSIdent($Name); 98 99 echo($Name.', '); … … 123 124 124 125 $DbResult2 = $Database->select('NetworkSubnet', '*', 'Member='.$Member['Id']); 125 while($Subnet = $DbResult2->fetch_a rray())126 while($Subnet = $DbResult2->fetch_assoc()) 126 127 { 127 128 $Subnet['Name'] = RouterOSIdent('subnet-'.$Subnet['Name']); … … 139 140 if($Index > 50) 140 141 { 142 //print_r($Commands); 141 143 $Commands = addslashes(implode(';', $Commands)); 142 144 $Command = '/usr/bin/ssh -l '.$Config['MainRouter']['UserName'].' -i id_dsa '.$Config['MainRouter']['HostName'].' "'.$Commands.'"'; … … 150 152 $Index++; 151 153 } 152 153 154 echo("\n"); 154 155 }
Note:
See TracChangeset
for help on using the changeset viewer.