Changeset 191 for trunk/system
- Timestamp:
- Apr 19, 2009, 3:40:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/traffic_shaping_routerboard.php
r190 r191 65 65 $Member['Name'] = RouterOSIdent($Member['Name']); 66 66 67 echo('Uživatel '.$Member['Name']. ": ");67 echo('Uživatel '.$Member['Name'].': '); 68 68 $Tariff = $Finance->Tarify[$Member['InternetTariffCurrentMonth']]; 69 69 $SpeedIn = round($Tariff['min_speed'] / $InDivider); … … 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 != "") ');77 $DbResult2 = $Database->select('hosts', 'COUNT(*)', '(block = 0) AND (MAC != "") AND (user='.$Member['Id'].')'); 78 78 $Row = $DbResult2->fetch_array(); 79 79 $HostCount = $Row[0]; … … 88 88 } 89 89 90 $DbResult2 = $Database->select('hosts', '*', ' block=0 AND MAC!="" AND user='.$Member['Id']);90 $DbResult2 = $Database->select('hosts', '*', '(block=0) AND (MAC != "") AND (user='.$Member['Id'].')'); 91 91 while($Host = $DbResult2->fetch_array()) 92 92 { … … 104 104 // Posílej po menších částech 105 105 if($Index > 50) 106 106 { 107 107 //print_r($Commands); 108 108 $Commands = addslashes(implode(';', $Commands)); … … 111 111 exec($Command, $Output); 112 112 print_r($Output); 113 114 115 113 $Commands = array(); 114 $Index = 0; 115 } 116 116 $Index++; 117 117 } … … 133 133 // Posílej po menších částech 134 134 if($Index > 50) 135 135 { 136 136 $Commands = addslashes(implode(';', $Commands)); 137 137 $Command = '/usr/bin/ssh -l '.$Config['MainRouter']['UserName'].' -i id_dsa '.$Config['MainRouter']['HostName'].' "'.$Commands.'"'; … … 141 141 print_r($Output); 142 142 $Commands = array(); 143 144 143 $Index = 0; 144 } 145 145 $Index++; 146 146 }
Note:
See TracChangeset
for help on using the changeset viewer.