diff --git a/application/forms/PreferenceForm.php b/application/forms/PreferenceForm.php index 424f76578..3ee1ebb38 100644 --- a/application/forms/PreferenceForm.php +++ b/application/forms/PreferenceForm.php @@ -185,6 +185,17 @@ class PreferenceForm extends Form ) ); + $this->addElement( + 'checkbox', + 'auto_refresh', + array( + 'required' => false, + 'label' => $this->translate('Enable auto refresh'), + 'description' => $this->translate('This option allows you to enable or to disable the global page content auto refresh'), + 'value' => 1 + ) + ); + if ($this->store) { $this->addElement( 'submit', diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php index f7a21c20e..8764e49ee 100644 --- a/library/Icinga/Web/Controller/ActionController.php +++ b/library/Icinga/Web/Controller/ActionController.php @@ -399,6 +399,10 @@ class ActionController extends Zend_Controller_Action $layout->benchmark = $this->renderBenchmark(); } } + + if ((bool) $user->getPreferences()->getValue('icingaweb', 'auto_refresh', true) === false) { + $this->disableAutoRefresh(); + } } if ($req->getParam('format') === 'pdf') {