diff --git a/inc/inc.ClassSettings.php b/inc/inc.ClassSettings.php index 0e2a7a5f7..bf7f22338 100644 --- a/inc/inc.ClassSettings.php +++ b/inc/inc.ClassSettings.php @@ -323,6 +323,10 @@ class Settings { /* {{{ */ var $_maxExecutionTime = null; // command timeout var $_cmdTimeout = 5; + // command failure on stderr has content + var $_cmdFailOnStderr = true; + // command failure on return code != 0 + var $_cmdFailOnRetcode = false; // debug mode var $_enableDebugMode = false; // Preview image width in lists @@ -863,6 +867,8 @@ class Settings { /* {{{ */ $this->_maxExecutionTime = intval($tab["maxExecutionTime"]); else $this->_maxExecutionTime = ini_get("max_execution_time"); + $this->_cmdFailOnStderr = Settings::boolval($tab["cmdFailOnStderr"]); + $this->_cmdFailOnRetcode = Settings::boolval($tab["cmdFailOnRetcode"]); $this->_enableDebugMode = Settings::boolval($tab["enableDebugMode"]); } @@ -1229,6 +1235,8 @@ class Settings { /* {{{ */ $this->setXMLAttributValue($node, "updateNotifyTime", $this->_updateNotifyTime); $this->setXMLAttributValue($node, "maxExecutionTime", $this->_maxExecutionTime); $this->setXMLAttributValue($node, "cmdTimeout", $this->_cmdTimeout); + $this->setXMLAttributValue($node, "cmdFailOnStderr", $this->_cmdFailOnStderr); + $this->setXMLAttributValue($node, "cmdFailOnRetcode", $this->_cmdFailOnRetcode); $this->setXMLAttributValue($node, "enableDebugMode", $this->_enableDebugMode); /* Check if there is still a converters list with a target attribute */ diff --git a/op/op.Settings.php b/op/op.Settings.php index 1984fa5d2..cd68e4e99 100644 --- a/op/op.Settings.php +++ b/op/op.Settings.php @@ -285,6 +285,8 @@ if ($action == "saveSettings") setIntValue("maxExecutionTime"); if(isset($_POST['cmdTimeout']) && !in_array('cmdTimeout', $settings->_hiddenConfFields)) $settings->_cmdTimeout = (intval($_POST["cmdTimeout"]) > 0) ?intval($_POST["cmdTimeout"]) : 5; + setBoolValue("cmdFailOnStderr"); + setBoolValue("cmdFailOnRetcode"); setBoolValue("enableDebugMode"); // SETTINGS - ADVANCED - INDEX CMD diff --git a/views/bootstrap/class.Settings.php b/views/bootstrap/class.Settings.php index be3e5141e..31e2c84bd 100644 --- a/views/bootstrap/class.Settings.php +++ b/views/bootstrap/class.Settings.php @@ -880,7 +880,8 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk)) showConfigText('settings_updateNotifyTime', 'updateNotifyTime'); ?> showConfigText('settings_maxExecutionTime', 'maxExecutionTime'); ?> showConfigText('settings_cmdTimeout', 'cmdTimeout'); ?> -showConfigCheckbox('settings_enableDebugMode', 'enableDebugMode'); ?> +showConfigCheckbox('settings_cmdFailOnStderr', 'cmdFailOnStderr'); ?> +showConfigCheckbox('settings_cmdFailOnRetcode', 'cmdFailOnRetcode'); ?>