_helper->layout()->disableLayout(); if (isset($_COOKIE['icingaweb2-session'])) { $last = (int) $_COOKIE['icingaweb2-session']; } else { $last = 0; } $now = time(); if ($last + 600 < $now) { Session::getSession()->write(); $params = session_get_cookie_params(); setcookie( 'icingaweb2-session', $now, null, $params['path'], $params['domain'], $params['secure'], $params['httponly'] ); $_COOKIE['icingaweb2-session'] = $now; } $announcementCookie = new AnnouncementCookie(); $announcementRepo = new AnnouncementIniRepository(); if ($announcementCookie->getEtag() !== $announcementRepo->getEtag()) { $announcementCookie ->setEtag($announcementRepo->getEtag()) ->setNextActive($announcementRepo->findNextActive()); $this->getResponse()->setCookie($announcementCookie); $this->getResponse()->setHeader('X-Icinga-Announcements', 'refresh', true); } else { $nextActive = $announcementCookie->getNextActive(); if ($nextActive && $nextActive <= $now) { $announcementCookie->setNextActive($announcementRepo->findNextActive()); $this->getResponse()->setCookie($announcementCookie); $this->getResponse()->setHeader('X-Icinga-Announcements', 'refresh', true); } } $this->getResponse()->setHeader('X-Icinga-Container', 'ignore', true); } }