Changeset 214 for trunk


Ignore:
Timestamp:
May 11, 2009, 9:28:16 PM (16 years ago)
Author:
george
Message:
  • Opraveno: Nezobrazovat nepoužité počítač v seznamu uživatelů.
  • Opraveno: Aktualizovat online stav zařízení dle stavu rozhraní.
  • Opraveno: Nepoužívané zařízení nezařazovat do systému omezování rychlosti.
Location:
trunk
Files:
3 edited

Legend:

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

    r213 r214  
    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('NetworkDevice', 'COUNT(*)', 'Member='.$Member['Id']);
     77  $DbResult2 = $Database->select('NetworkDevice', 'COUNT(*)', 'Used = 1 AND Member='.$Member['Id']);
    7878  $Row = $DbResult2->fetch_row();
    7979  $HostCount = $Row[0];
     
    8888  }
    8989
    90   $DbResult2 = $Database->select('NetworkDevice', '*', 'Member = '.$Member['Id']);
     90  $DbResult2 = $Database->select('NetworkDevice', '*', 'Used = 1 AND Member = '.$Member['Id']);
    9191  while($Device = $DbResult2->fetch_assoc())
    9292  {
  • trunk/system/netwatch_import.php

    r213 r214  
    3434    {
    3535      $Online = 1;
    36       $Values = array('Online' => $Online,  'LastOnline' => 'NOW()');
     36      $Values = array('Online' => $Online, 'LastOnline' => 'NOW()');
    3737    } else
    3838    {
     
    4545    {
    4646      $DbResult = $Database->select('NetworkInterface', 'Id', 'LocalIP = "'.$Properties['host'].'"');
    47       $DbRow = $DbResult->fetch_array();
     47      $DbRow = $DbResult->fetch_assoc();
    4848      $HostId = $DbRow['Id'];
    4949      $DbResult2 = $Database->select('stat_hosts', '*', '(host_id="'.$HostId.'") AND (time = DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))');
     
    5454}
    5555
     56// Update device online state
     57$DbResult = $Database->select('NetworkDevice', 'Id', 'Used=1');
     58while($Device = $DbResult->fetch_assoc())
     59{
     60  $DbResult2 = $Database->select('NetworkInterface', 'SUM(Online)', 'Device='.$Device['Id']);
     61  $DbRow = $DbResult2->fetch_array();
     62  if($DbRow['SUM(Online)'] > 0) $Online = 1; else $Online = 0; 
     63  $Database->update('NetworkDevice', 'Id='.$Device['Id'], array('Online' => $Online));
     64}
     65
    5666?>
  • trunk/userlist.php

    r208 r214  
    1717      if($User['PhoneNumber'] > 0) $Phone = $User['PhoneNumber']; else $Phone = ' ';
    1818
    19       $DbResult2 = $this->Database->query('SELECT Name, Id FROM NetworkDevice WHERE Member = (SELECT Id FROM Member WHERE Member.ResponsibleUser = '.$User['Id'].') ORDER BY Name');
     19      $DbResult2 = $this->Database->query('SELECT Name, Id FROM NetworkDevice WHERE Member = (SELECT Id FROM Member WHERE Member.ResponsibleUser = '.$User['Id'].') AND Used=1 ORDER BY Name');
    2020      $Devices = array();
    2121      while($Device = $DbResult2->fetch_assoc())
Note: See TracChangeset for help on using the changeset viewer.