Ignore:
Timestamp:
Apr 19, 2009, 3:40:37 PM (16 years ago)
Author:
george
Message:
  • Opraveno: Určení minimální garantované rychlost pro jednotlivé počítače v řízení rychlosti internetu.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/system/generators/traffic_shaping_routerboard.php

    r190 r191  
    6565  $Member['Name'] = RouterOSIdent($Member['Name']);
    6666
    67   echo('Uživatel '.$Member['Name'].": ");
     67  echo('Uživatel '.$Member['Name'].': ');
    6868  $Tariff = $Finance->Tarify[$Member['InternetTariffCurrentMonth']];
    6969  $SpeedIn = round($Tariff['min_speed'] / $InDivider);
     
    7575  $Commands[] = ' /queue tree add name='.$Member['Name'].'-in limit-at='.$SpeedOut.' max-limit='.$UserMaxSpeedOut.' parent=main-in queue=wireless-default';
    7676
    77   $DbResult2 = $Database->select('hosts', 'COUNT(*)', '(block = 0) AND (MAC != "")');
     77  $DbResult2 = $Database->select('hosts', 'COUNT(*)', '(block = 0) AND (MAC != "") AND (user='.$Member['Id'].')');
    7878  $Row = $DbResult2->fetch_array();
    7979  $HostCount = $Row[0];
     
    8888  }
    8989
    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'].')');
    9191  while($Host = $DbResult2->fetch_array())
    9292  {
     
    104104    // Posílej po menších částech
    105105    if($Index > 50)
    106           {
     106    {
    107107      //print_r($Commands);
    108108      $Commands = addslashes(implode(';', $Commands));
     
    111111      exec($Command, $Output);
    112112      print_r($Output);
    113           $Commands = array();
    114             $Index = 0;
    115           }
     113      $Commands = array();
     114      $Index = 0;
     115    }
    116116    $Index++;
    117117  }
     
    133133    // Posílej po menších částech
    134134    if($Index > 50)
    135           {
     135    {
    136136      $Commands = addslashes(implode(';', $Commands));
    137137      $Command = '/usr/bin/ssh -l '.$Config['MainRouter']['UserName'].' -i id_dsa '.$Config['MainRouter']['HostName'].' "'.$Commands.'"';
     
    141141      print_r($Output);
    142142          $Commands = array();
    143             $Index = 0;
    144           }
     143      $Index = 0;
     144    }
    145145    $Index++;
    146146  }
Note: See TracChangeset for help on using the changeset viewer.