2015-11-16 14:19:33 +01:00
|
|
|
<?php
|
2016-02-08 15:41:00 +01:00
|
|
|
/* Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */
|
2015-11-16 14:19:33 +01:00
|
|
|
|
|
|
|
namespace Icinga\Controllers;
|
|
|
|
|
|
|
|
use Icinga\Application\Icinga;
|
|
|
|
use Icinga\Web\Controller;
|
|
|
|
use Icinga\Web\Session;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @TODO(el): https://dev.icinga.org/issues/10646
|
|
|
|
*/
|
|
|
|
class ApplicationStateController extends Controller
|
|
|
|
{
|
|
|
|
public function indexAction()
|
|
|
|
{
|
|
|
|
if (isset($_COOKIE['icingaweb2-session'])) {
|
|
|
|
$last = (int) $_COOKIE['icingaweb2-session'];
|
|
|
|
} else {
|
|
|
|
$last = 0;
|
|
|
|
}
|
|
|
|
$now = time();
|
2015-12-16 12:55:41 +01:00
|
|
|
if ($last + 600 < $now) {
|
2015-11-16 15:34:26 +01:00
|
|
|
Session::getSession()->write();
|
2015-11-16 14:19:33 +01:00
|
|
|
$params = session_get_cookie_params();
|
|
|
|
setcookie(
|
|
|
|
'icingaweb2-session',
|
|
|
|
$now,
|
|
|
|
null,
|
|
|
|
$params['path'],
|
|
|
|
$params['domain'],
|
|
|
|
$params['secure'],
|
|
|
|
$params['httponly']
|
|
|
|
);
|
|
|
|
$_COOKIE['icingaweb2-session'] = $now;
|
|
|
|
}
|
|
|
|
Icinga::app()->getResponse()->setHeader('X-Icinga-Container', 'ignore', true);
|
|
|
|
}
|
|
|
|
}
|