Code

Updated tempalte
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 May 2010 12:37:43 +0000 (12:37 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 May 2010 12:37:43 +0000 (12:37 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18370 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/addons/configViewer/class_commandVerifier.inc

index 952ccdb4fcd46f84c1486965e391807c89333a51..92244ca9e24d879c517be67ca88c9620900f1138 100644 (file)
@@ -22,16 +22,20 @@ class commandVerifier
             $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');
+                $res = trim(htmlentities(stream_get_contents($pipes[1]),ENT_COMPAT,'UTF-8'));
+                $err = trim(htmlentities(stream_get_contents($pipes[2]),ENT_COMPAT,'UTF-8'));
                 fclose($pipes[0]);
                 fclose($pipes[1]);
                 fclose($pipes[2]);
                 $code = proc_close($process);
+
+                if(!empty($err)) $err = "<pre>{$err}</pre>";
+                if(!empty($res)) $res = "<pre>{$res}</pre>";
+
                 $output = "
                     <table summary='"._("Results")."'>
-                    <tr><td><b>Result:</b></td><td><pre>$res</pre></td></tr>
-                    <tr><td><b>Error:</b></td><td><pre>$err</pre></td></tr>
+                    <tr><td><b>Result:</b></td><td>$res</td></tr>
+                    <tr><td><b>Error:</b></td><td>$err</td></tr>
                     <tr><td><b>Return code:</b></td><td>$code</td></tr>
                     </table>";
             }