Properly handle window id's and container id's
This commit is contained in:
parent
2d3fc218db
commit
855bb8ae72
|
@ -229,10 +229,9 @@ class ActionController extends Zend_Controller_Action
|
|||
public function Window()
|
||||
{
|
||||
if ($this->window === null) {
|
||||
$this->window = new Window(
|
||||
$this->_request->getHeader('X-Icinga-WindowId', Window::UNDEFINED)
|
||||
);
|
||||
$this->window = Window::getInstance();
|
||||
}
|
||||
|
||||
return $this->window;
|
||||
}
|
||||
|
||||
|
|
|
@ -114,12 +114,7 @@ class Request extends Zend_Controller_Request_Http
|
|||
*/
|
||||
public function protectId($id)
|
||||
{
|
||||
if (! isset($this->uniqueId)) {
|
||||
$windowId = $this->getHeader('X-Icinga-WindowId');
|
||||
$this->uniqueId = empty($windowId) ? Window::generateId() : $windowId;
|
||||
}
|
||||
|
||||
return $id . '-' . $this->uniqueId;
|
||||
return $id . '-' . Window::getInstance()->getContainerId();
|
||||
}
|
||||
|
||||
public function getPost($key = null, $default = null)
|
||||
|
|
|
@ -113,8 +113,8 @@ class Window
|
|||
if (! isset(static::$window)) {
|
||||
$id = Icinga::app()->getRequest()->getHeader('X-Icinga-WindowId');
|
||||
if (empty($id) || $id === static::UNDEFINED) {
|
||||
Icinga::app()->getResponse()->setOverrideWindowId();
|
||||
$id = static::generateId();
|
||||
Icinga::app()->getResponse()->setHeader('X-Icinga-WindowId', $id);
|
||||
}
|
||||
|
||||
static::$window = new Window($id);
|
||||
|
|
Loading…
Reference in New Issue