From: hickert Date: Tue, 11 May 2010 11:59:27 +0000 (+0000) Subject: Updated command verifier X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0838bfbd9623c681c4fc34f2774059e962de0829;p=gosa.git Updated command verifier git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18365 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/addons/configViewer/class_commandVerifier.inc b/gosa-core/plugins/addons/configViewer/class_commandVerifier.inc index a784ca74f..b9b4b63c7 100644 --- a/gosa-core/plugins/addons/configViewer/class_commandVerifier.inc +++ b/gosa-core/plugins/addons/configViewer/class_commandVerifier.inc @@ -27,7 +27,34 @@ class commandVerifier $output = "code: {$code}\nreturn: {$ret}"; } - + + + $descriptorspec = array( + 0 => array("pipe", "w"), + 1 => array("pipe", "w"), + 2 => array("pipe", "w")); + + + $process = proc_open($this->command, $descriptorspec, $pipes); + if (is_resource($process)) { + + $send= stream_get_contents($pipes[0]); + $res = htmlentities(stream_get_contents($pipes[1]),ENT_COMPAT,'UTF-8'); + $err = htmlentities(stream_get_contents($pipes[2]),ENT_COMPAT,'UTF-8'); + fclose($pipes[0]); + fclose($pipes[1]); + fclose($pipes[2]); + + $code = proc_close($process); + + $output = " + + + + +
Result:$res
Error:$err
Return code:$code
"; + } + $smarty->assign('value', htmlentities($this->command,ENT_COMPAT,'UTF-8')); $smarty->assign('output', $output); return($smarty->fetch(get_template_path('commandVerifier.tpl', 'TRUE'))); diff --git a/gosa-core/plugins/addons/configViewer/commandVerifier.tpl b/gosa-core/plugins/addons/configViewer/commandVerifier.tpl index 1c912d3e2..7cc97234e 100644 --- a/gosa-core/plugins/addons/configViewer/commandVerifier.tpl +++ b/gosa-core/plugins/addons/configViewer/commandVerifier.tpl @@ -9,7 +9,7 @@

{t}The generated output{/t} - + {$output}