Fix to the previous commit

pull/679/head
Iglocska 2015-09-23 12:32:00 +02:00
parent 6ef7772e0b
commit a55e38ffda
3 changed files with 8 additions and 3 deletions

View File

@ -319,7 +319,7 @@ class ServersController extends AppController {
$stixOperational = array(0 => 'STIX or CyBox library not installed correctly', 1 => 'OK');
$stixVersion = array(0 => 'Incorrect STIX version installed, found $current, expecting $expected', 1 => 'OK');
$cyboxVersion = array(0 => 'Incorrect CyBox version installed, found $current, expecting $expected', 1 => 'OK');
$sessionErrors = array(0 => 'OK', 1 => 'High', 2 => 'Alternative setting used');
$sessionErrors = array(0 => 'OK', 1 => 'High', 2 => 'Alternative setting used', 3 => 'Test failed');
$finalSettings = $this->Server->serverSettingsRead();
$issues = array(

View File

@ -1557,7 +1557,12 @@ class Server extends AppModel {
return 2;
}
$sql = 'SELECT COUNT(id) FROM `cake_sessions` WHERE `expires` < ' . time() . ';';
$sessionCount = $this->query($sql)[0][0]['COUNT(id)'];
$sqlResult = $this->query($sql);
if (isset($sqlResult[0][0])) $sessionCount = $sqlResult[0][0]['COUNT(id)'];
else {
$sessionCount = 'Error';
return 3;
}
$sessionStatus = 0;
if ($sessionCount > 100) {
$sessionStatus = 1;

View File

@ -133,7 +133,7 @@
<?php
$colour = 'green';
$message = $sessionErrors[$sessionStatus];
$sessionColours = array(0 => 'green', 1 => 'red', 2 => 'orange');
$sessionColours = array(0 => 'green', 1 => 'red', 2 => 'orange', 3 => 'red');
$colour = $sessionColours[$sessionStatus];
echo 'Expired sessions....<span style="color:' . $colour . ';">' . $sessionCount . ' (' . $message . ')' . '</span>';
?>