mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Add SystemPermissionException
This exception should be fired when the OS restricts the web user from executing certain actions. Also the template for errors has been modified so it displays the action and the target that was prevented. refs #4092
This commit is contained in:
parent
c58e32c365
commit
c155a8330c
@ -34,7 +34,6 @@ class ErrorController extends ActionController
|
||||
$this->view->message = 'Application error';
|
||||
break;
|
||||
}
|
||||
|
||||
// conditionally display exceptions
|
||||
if ($this->getInvokeArg('displayExceptions') == true) {
|
||||
$this->view->exception = $errors->exception;
|
||||
|
@ -11,6 +11,13 @@
|
||||
|
||||
<p>
|
||||
<b>Message:</b> <?php echo $this->exception->getMessage() ?>
|
||||
<?php if (isset($this->exception->action)): ?>
|
||||
<br/><b>Action</b>: <?= $this->exception->action; ?>
|
||||
<?php endif ?>
|
||||
<?php if (isset($this->exception->action)): ?>
|
||||
<br/><b>Target</b>: <?= $this->exception->target; ?>
|
||||
<?php endif ?>
|
||||
|
||||
</p>
|
||||
|
||||
<h3>Stack trace:</h3>
|
||||
|
22
library/Icinga/Exception/SystemPermissionException.php
Normal file
22
library/Icinga/Exception/SystemPermissionException.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
|
||||
namespace Icinga\Exception;
|
||||
|
||||
/**
|
||||
* Class ProgrammingError
|
||||
* @package Icinga\Exception
|
||||
*/
|
||||
class SystemPermissionException extends \Exception
|
||||
{
|
||||
public $action;
|
||||
public $target;
|
||||
|
||||
public function __construct($message, $action, $target = "")
|
||||
{
|
||||
parent::__construct($message);
|
||||
$this->action = $action;
|
||||
$this->target = $target;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user