mirror of
				https://github.com/Icinga/icingaweb2.git
				synced 2025-10-31 03:14:31 +01:00 
			
		
		
		
	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() |     public function Window() | ||||||
|     { |     { | ||||||
|         if ($this->window === null) { |         if ($this->window === null) { | ||||||
|             $this->window = new Window( |             $this->window = Window::getInstance(); | ||||||
|                 $this->_request->getHeader('X-Icinga-WindowId', Window::UNDEFINED) |  | ||||||
|             ); |  | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|         return $this->window; |         return $this->window; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -114,12 +114,7 @@ class Request extends Zend_Controller_Request_Http | |||||||
|      */ |      */ | ||||||
|     public function protectId($id) |     public function protectId($id) | ||||||
|     { |     { | ||||||
|         if (! isset($this->uniqueId)) { |         return $id . '-' . Window::getInstance()->getContainerId(); | ||||||
|             $windowId = $this->getHeader('X-Icinga-WindowId'); |  | ||||||
|             $this->uniqueId = empty($windowId) ? Window::generateId() : $windowId; |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         return $id . '-' . $this->uniqueId; |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public function getPost($key = null, $default = null) |     public function getPost($key = null, $default = null) | ||||||
|  | |||||||
| @ -113,8 +113,8 @@ class Window | |||||||
|         if (! isset(static::$window)) { |         if (! isset(static::$window)) { | ||||||
|             $id = Icinga::app()->getRequest()->getHeader('X-Icinga-WindowId'); |             $id = Icinga::app()->getRequest()->getHeader('X-Icinga-WindowId'); | ||||||
|             if (empty($id) || $id === static::UNDEFINED) { |             if (empty($id) || $id === static::UNDEFINED) { | ||||||
|  |                 Icinga::app()->getResponse()->setOverrideWindowId(); | ||||||
|                 $id = static::generateId(); |                 $id = static::generateId(); | ||||||
|                 Icinga::app()->getResponse()->setHeader('X-Icinga-WindowId', $id); |  | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             static::$window = new Window($id); |             static::$window = new Window($id); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user