Changeset 819


Ignore:
Timestamp:
Mar 16, 2016, 10:20:36 PM (9 years ago)
Author:
chronos
Message:
  • Fixed: Checking network port states.
  • Modified: Check only state of enabled interfaces.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r818 r819  
    11<?php
    22
    3 $Revision = 818; // Subversion revision
     3$Revision = 819; // Subversion revision
    44$DatabaseRevision = 818; // SQL structure revision
    55$ReleaseTime = strtotime('2016-03-16');
  • trunk/Modules/Network/Network.php

    r818 r819  
    712712      'LEFT JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` '.
    713713      $Condition.' AND (`NetworkDevice`.`PermanentOnline`=1) AND (`NetworkDevice`.`Used`=1) AND '.
    714       '(`NetworkInterface`.`LocalIP` != "") '.
     714      '(`NetworkInterface`.`LocalIP` != "") AND (`NetworkInterface`.`Enabled` == 1)'.
    715715      'ORDER BY `Name` ASC');
    716716    if($DbResult3->num_rows > 0)
  • trunk/Modules/NetworkConfigLinux/Generators/CheckPorts.php

    r818 r819  
    77    $Timeout = 1;
    88    $State = 0;
    9     if($Protocol = 'tcp') $Prefix = '';
    10       else if($Protocol = 'udp') $Prefix = 'udp://';
     9    if($Protocol == 'tcp') $Prefix = '';
     10      else if($Protocol == 'udp') $Prefix = 'udp://';
    1111      else throw new Exception('Unsupported protocol "'.$Protocol.'"');
    1212    if($Socket = @fsockopen($Prefix.$IP, $Port, $ErrorNumber, $ErrorString, $Timeout))
     
    5656          '`TM`.`Time`, (SELECT `Time` FROM (SELECT * FROM `NetworkPortUpDown`) AS `TA` WHERE (`TA`.`Time` > `TM`.`Time`) '.
    5757          'AND (`TA`.`Port`=`TM`.`Port`) ORDER BY `TA`.`Time` ASC LIMIT 1)) '.
    58           'WHERE (`TM`.`Duration` IS NULL) AND (`TM`.`Interface` ='.$Port['Id'].')');
     58          'WHERE (`TM`.`Duration` IS NULL) AND (`TM`.`Port` ='.$Port['Id'].')');
    5959      }
    6060    }
    61     $DbResult = $this->Database->update('NetworkDevice', '`LastOnline` < "'.TimeToMysqlDateTime($StartTime).'"', array('Online' => 0));
     61    $DbResult = $this->Database->update('NetworkPort', '`LastOnline` < "'.
     62      TimeToMysqlDateTime($StartTime).'"', array('Online' => 0));
    6263
    6364    // Set offline all ports which were not updated as online
Note: See TracChangeset for help on using the changeset viewer.