diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-07-03 19:40:28 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-07-03 19:40:28 +0000 |
commit | d269563b39c52769288d13a4bb6da83fe17b6b08 (patch) | |
tree | ae8ee08782dc8b0aac9223d5519f2ae018c47d5a /usr/local/www | |
parent | 1ed2947caa600c1bd172ede9e374ce85b0ce6348 (diff) | |
download | pfsense-d269563b39c52769288d13a4bb6da83fe17b6b08.zip pfsense-d269563b39c52769288d13a4bb6da83fe17b6b08.tar.gz |
MFC 12872
Fix the date parsing so it works properly on single digit days of the month.
This was a presentation issue and caused incorrect display of the change date.
Also display when we have no changes on log.
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/status_slbd_pool.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usr/local/www/status_slbd_pool.php b/usr/local/www/status_slbd_pool.php index 5e1c7ef..c3030f8 100755 --- a/usr/local/www/status_slbd_pool.php +++ b/usr/local/www/status_slbd_pool.php @@ -91,9 +91,10 @@ include("head.inc"); $svr = split("\|", $server); $monitorip = $svr[1]; $logstates = return_clog($slbd_logfile, $nentries, array("$monitorip", "marking"), true); + $logstates = $logstates[0]; - if(stristr($logstates[0], $monitorip)) { - $date = split(" ", $logstates[0]); + if(stristr($logstates, $monitorip)) { + $date = preg_split("/[ ]+/" , $logstates); $lastchange = "$date[0] $date[1] $year $date[2]"; } if(stristr($poolstatus, $monitorip)) { @@ -107,7 +108,13 @@ include("head.inc"); $online = "Offline"; $bgcolor = "lightcoral"; } - PRINT "<tr><td bgcolor=\"$bgcolor\" > $online </td><td> Last change $lastchange</td></tr>"; + PRINT "<tr><td bgcolor=\"$bgcolor\" > $online </td><td>"; + if($lastchange <> "") { + PRINT "Last change $lastchange"; + } else { + PRINT "No changes found in logfile"; + } + PRINT "</td></tr>"; } } else { PRINT "<tr><td> {$vipent['monitor']} </td></tr>"; |