Changeset 868


Ignore:
Timestamp:
Jan 13, 2020, 1:10:38 AM (5 years ago)
Author:
chronos
Message:
  • Fixed: Wrong condition evaluation in check network availability and port status.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r867 r868  
    11<?php
    22
    3 $Revision = 867; // Subversion revision
     3$Revision = 868; // Subversion revision
    44$DatabaseRevision = 867; // SQL structure revision
    55$ReleaseTime = strtotime('2020-01-13');
  • trunk/Modules/Network/Network.php

    r867 r868  
    816816    $Output = '';
    817817    $Condition = 'WHERE (`NetworkInterface`.`LastOnline` <= "'.TimeToMysqlDateTime($Time - $MinDuration).'")';
    818     if ($OnlineNow != null) $Condition .= ' AND (`NetworkInterface`.`Online` = '.$OnlineNow.')';
    819     if ($OnlinePrevious != null) $Condition .= ' AND (`NetworkInterface`.`OnlineNotify` = '.$OnlinePrevious.')';
     818    echo($OnlineNow);
     819    if ($OnlineNow >= 0) $Condition .= ' AND (`NetworkInterface`.`Online` = '.$OnlineNow.')';
     820    echo($OnlinePrevious);
     821    if ($OnlinePrevious >= 0) $Condition .= ' AND (`NetworkInterface`.`OnlineNotify` = '.$OnlinePrevious.')';
     822    echo($Condition."\n");
    820823    $DbResult3 = $this->Database->query('SELECT CONCAT_WS("-", `NetworkDevice`.`Name`, NULLIF(`NetworkInterface`.`Name`, "")) AS `Name`, '.
    821824      '`NetworkInterface`.`Online`, `NetworkInterface`.`LastOnline` FROM `NetworkInterface` '.
     
    854857    $NewOffline = $this->OnlineList('Nově offline', 0, 1, $this->MinNotifyTime);
    855858    $Output .= $NewOffline['Report'];
    856     if ($Output != '')
    857     {
    858       $StillOffline = $this->OnlineList('Stále offline', 0, 0, 0);
    859       $Output .= $StillOffline['Report'];
    860     }
    861     $Offline = $this->OnlineList('Offline', 0, null, 0);
     859    $StillOffline = $this->OnlineList('Stále offline', 0, 0, 0);
     860    $Output .= $StillOffline['Report'];
     861    $Offline = $this->OnlineList('Offline', 0, -1, 0);
    862862    return(array('Report' => $Output, 'Count' => $Offline['Count'], 'ShortTitle' => 'Odezva'));
    863863  }
     
    869869    $Output = '';
    870870    $Condition = 'WHERE (`NetworkPort`.`LastOnline` <= "'.TimeToMysqlDateTime($Time - $MinDuration).'")';
    871     if ($OnlineNow != null) $Condition .= ' AND (`NetworkPort`.`Online` = '.$OnlineNow.')';
    872     if ($OnlinePrevious != null) $Condition .= ' AND (`NetworkPort`.`OnlineNotify` = '.$OnlinePrevious.')';
     871    if ($OnlineNow >= null) $Condition .= ' AND (`NetworkPort`.`Online` = '.$OnlineNow.')';
     872    if ($OnlinePrevious >= null) $Condition .= ' AND (`NetworkPort`.`OnlineNotify` = '.$OnlinePrevious.')';
    873873    $DbResult3 = $this->Database->query('SELECT CONCAT(CONCAT_WS("-", `NetworkDevice`.`Name`, NULLIF(`NetworkInterface`.`Name`, "")), ":", `NetworkPort`.`Number`, "(", `NetworkPort`.`Name`, ")") AS `Name`, '.
    874874      '`NetworkPort`.`Online`, `NetworkPort`.`LastOnline` FROM `NetworkPort` '.
     
    909909    $NewOffline = $this->PortCheckList('Nově offline', 0, 1, $this->MinNotifyTime);
    910910    $Output .= $NewOffline['Report'];
    911     if ($Output != '')
    912     {
    913       $StillOffline = $this->PortCheckList('Stále offline', 0, 0, 0);
    914       $Output .= $StillOffline['Report'];
    915     }
    916     $Offline = $this->PortCheckList('Offline', 0, null, 0);
     911    $StillOffline = $this->PortCheckList('Stále offline', 0, 0, 0);
     912    $Output .= $StillOffline['Report'];
     913    $Offline = $this->PortCheckList('Offline', 0, -1, 0);
    917914    return(array('Report' => $Output, 'Count' => $Offline['Count'], 'ShortTitle' => 'Port'));
    918915  }
  • trunk/Modules/Notify/Notify.php

    r867 r868  
    9797      {
    9898        $Mail = new Mail();
    99         $Mail->Subject = 'Notification';
     99        $Mail->Subject = $Title;
    100100        $Mail->AddTo($User['Value'], $User['Name']);
    101101        $Mail->AddBody(strip_tags($Content), 'text/plain');
     
    109109        $Output .= strip_tags(str_replace("</", " </", str_replace('<br/>', "\n", $Content)));
    110110      }
    111 
    112       return($Output);
    113111    }
    114112
     
    121119      );
    122120    }
     121
     122    return($Output);
    123123  }
    124124
Note: See TracChangeset for help on using the changeset viewer.