mirror of https://github.com/MISP/MISP
Fix to the previous commit
parent
6ef7772e0b
commit
a55e38ffda
|
@ -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(
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>';
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue