/application-state: ignore unauthenticated requests

refs #2882
This commit is contained in:
Alexander A. Klimov 2018-01-15 14:21:20 +01:00
parent 5cb7deda20
commit b790cc98c1

View File

@ -14,9 +14,13 @@ use Icinga\Web\Session;
*/ */
class ApplicationStateController extends Controller class ApplicationStateController extends Controller
{ {
protected $requiresAuthentication = false;
public function indexAction() public function indexAction()
{ {
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
if ($this->Auth()->isAuthenticated()) {
if (isset($_COOKIE['icingaweb2-session'])) { if (isset($_COOKIE['icingaweb2-session'])) {
$last = (int) $_COOKIE['icingaweb2-session']; $last = (int) $_COOKIE['icingaweb2-session'];
} else { } else {
@ -53,6 +57,7 @@ class ApplicationStateController extends Controller
$this->getResponse()->setHeader('X-Icinga-Announcements', 'refresh', true); $this->getResponse()->setHeader('X-Icinga-Announcements', 'refresh', true);
} }
} }
}
$this->getResponse()->setHeader('X-Icinga-Container', 'ignore', true); $this->getResponse()->setHeader('X-Icinga-Container', 'ignore', true);
} }