diff --git a/library/Icinga/Authentication/Auth.php b/library/Icinga/Authentication/Auth.php index 74eb0ad96..ffdddeb67 100644 --- a/library/Icinga/Authentication/Auth.php +++ b/library/Icinga/Authentication/Auth.php @@ -5,6 +5,7 @@ namespace Icinga\Authentication; use Exception; use Icinga\Application\Config; +use Icinga\Application\Icinga; use Icinga\Application\Logger; use Icinga\Authentication\UserGroup\UserGroupBackend; use Icinga\Data\ConfigObject; @@ -24,6 +25,13 @@ class Auth */ private static $instance; + /** + * Request + * + * @var \Icinga\Web\Request + */ + protected $request; + /** * Authenticated user * @@ -159,6 +167,19 @@ class Auth return $this->user->getGroups(); } + /** + * Get the request + * + * @return \Icinga\Web\Request + */ + public function getRequest() + { + if ($this->request === null) { + $this->request = Icinga::app()->getFrontController()->getRequest(); + } + return $this->request; + } + /** * Get applied restrictions matching a given restriction name *