diff --git a/library/Icinga/Web/Request.php b/library/Icinga/Web/Request.php index 6fb078c96..b4d7e92d4 100644 --- a/library/Icinga/Web/Request.php +++ b/library/Icinga/Web/Request.php @@ -3,6 +3,7 @@ namespace Icinga\Web; +use Icinga\Application\Icinga; use Zend_Controller_Request_Http; use Icinga\User; @@ -32,6 +33,13 @@ class Request extends Zend_Controller_Request_Http */ protected $url; + /** + * Response + * + * @var Response + */ + protected $response; + /** * Get whether the request seems to be an API request * @@ -78,6 +86,20 @@ class Request extends Zend_Controller_Request_Http return $this; } + /** + * Get the response + * + * @return Response + */ + public function getResponse() + { + if ($this->response === null) { + $this->response = Icinga::app()->getResponse(); + } + + return $this->response; + } + /** * Makes an ID unique to this request, to prevent id collisions in different containers * @@ -96,4 +118,10 @@ class Request extends Zend_Controller_Request_Http } return $id . '-' . $this->uniqueId; } + + public function hasCookieSupport() + { + $cookie = new Cookie($this); + return $cookie->isSupported(); + } }