diff --git a/application/forms/Config/General/ApplicationConfigForm.php b/application/forms/Config/General/ApplicationConfigForm.php index 618178344..4e431aab2 100644 --- a/application/forms/Config/General/ApplicationConfigForm.php +++ b/application/forms/Config/General/ApplicationConfigForm.php @@ -25,6 +25,20 @@ class ApplicationConfigForm extends Form */ public function createElements(array $formData) { + $this->addElement( + 'checkbox', + 'global_show_stacktraces', + array( + 'required' => true, + 'value' => true, + 'label' => $this->translate('Show Stacktraces'), + 'description' => $this->translate( + 'Set whether to show an exception\'s stacktrace by default. This can also' + . ' be set in a user\'s preferences with the appropriate permission.' + ) + ) + ); + $this->addElement( 'text', 'global_module_path', diff --git a/library/Icinga/Application/Web.php b/library/Icinga/Application/Web.php index 8386efc6b..538442818 100644 --- a/library/Icinga/Application/Web.php +++ b/library/Icinga/Application/Web.php @@ -212,9 +212,12 @@ class Web extends EmbeddedWeb $this->frontController = Zend_Controller_Front::getInstance(); $this->frontController->setRequest($this->getRequest()); $this->frontController->setControllerDirectory($this->getApplicationDir('/controllers')); + + $displayExceptions = $this->config->get('global', 'show_stacktraces', true); + $this->frontController->setParams( array( - 'displayExceptions' => true + 'displayExceptions' => $displayExceptions ) ); return $this; diff --git a/modules/setup/library/Setup/Steps/GeneralConfigStep.php b/modules/setup/library/Setup/Steps/GeneralConfigStep.php index 7924d87d0..8f49b9559 100644 --- a/modules/setup/library/Setup/Steps/GeneralConfigStep.php +++ b/modules/setup/library/Setup/Steps/GeneralConfigStep.php @@ -53,6 +53,10 @@ class GeneralConfigStep extends Step $generalHtml = '' . '