diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc
index b93f4c5d89a049915e019ffdbab293c7f2ca201f..25b8bd30daa089122b8ffc09382c2e13d1f5261b 100644 (file)
var $ui= NULL;
var $acl= "";
var $DivListSystem;
var $ui= NULL;
var $acl= "";
var $DivListSystem;
- var $image_creation_log ="";
function systems ($config, $ui)
{
function systems ($config, $ui)
{
if ($this->dn != "" && isset($_GET['PerformIsoCreation'])){
if ($this->dn != "" && isset($_GET['PerformIsoCreation'])){
- /* Initialize some attributes */
- $this->image_creation_log =
-"
-GOsa - FAI image
-Date : ".date("d.m.Y - H:i:s")."
-User-cn : ".$this->ui->cn."
-User-dn : ".$this->ui->dn."
-
-Object-dn : ".$this->dn."
-
-/* Script returned : */
-";
-
- $download_button = "<a href='?plug=".$_GET['plug']."&download_image_log' class='center' >".
- "<img src='images/save.png' border=0 class='center'>".
- _("Use this link to download the logfile")."</a>";
-
- $return_button = "<a href='?plug=".$_GET['plug']."' target='parent' class='center'> ".
- " <img src='images/list_reload.png' border=0 class='center'>".
- _("Back to work")."</a>";
+ $return_button = "<form method='get' action='main.php' target='_parent'>
+ <input type='submit' value='"._("Back")."'>
+ <input type='hidden' name='plug' value='".$_GET['plug']."'/>
+ </form>";
$dsc = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w"));
/* Get and check command */
$command= search_config($this->config->data['TABS'], "workgeneric", "ISOCMD");
$dsc = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w"));
/* Get and check command */
$command= search_config($this->config->data['TABS'], "workgeneric", "ISOCMD");
-// $command = "/bin/sh /home/hickert/gen_stuff.sh";
if (check_command($command)){
@DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__, $command, "Execute");
/* Print out html introduction */
if (check_command($command)){
@DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__, $command, "Execute");
/* Print out html introduction */
- echo '<!-- headers.tpl--><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/transitional.dtd">
- <html><head><title></title><style type="text/css">@import url("themes/default/style.css");</style>';
- echo "<script language=\"javascript\" src=\"include/focus.js\" type=\"text/javascript\"></script>";
- echo "</head>";
- echo "<body style='background: none;'>
- <script language=\"javascript\" type=\"text/javascript\">
- document.body.scrollTop = document.body.scrollHeight - document.body.clientHeight;
- </script>
- <pre>";
+ echo ' <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+ <html>
+ <head>
+ <title></title>
+ <style type="text/css">@import url("themes/default/style.css");</style>
+ <script language="javascript" src="include/focus.js" type="text/javascript"></script>
+ </head>
+ <body style="background: none; margin:4px;" id="body" >
+ <pre>';
/* Open process handle and check if it is a valid process */
/* Open process handle and check if it is a valid process */
- $process= proc_open($command, $dsc, $pipes, '/tmp');
+ $process= proc_open($command, $dsc, $pipes);
if (is_resource($process)) {
fclose($pipes[0]);
/* Print out returned lines && write JS to scroll down each line */
while (!feof($pipes[1])){
$cur_dat = fgets($pipes[1], 1024);
if (is_resource($process)) {
fclose($pipes[0]);
/* Print out returned lines && write JS to scroll down each line */
while (!feof($pipes[1])){
$cur_dat = fgets($pipes[1], 1024);
- $this->image_creation_log .= $cur_dat;
echo $cur_dat;
echo $cur_dat;
- echo "<script language=\"javascript\" type=\"text/javascript\">scrollDown2();</script>" ;
+ echo '<script language="javascript" type="text/javascript">scrollDown2();</script>' ;
flush();
}
}
/* Get error string && close streams */
flush();
}
}
/* Get error string && close streams */
- $buffer= stream_get_contents($pipes[2]);
+ $buffer = "";
+ while (!feof($pipes[2])){
+ $buffer .= fgets($pipes[2],256);
+ }
+
fclose($pipes[1]);
fclose($pipes[2]);
echo "</pre>";
/* Check return code */
$ret= proc_close($process);
fclose($pipes[1]);
fclose($pipes[2]);
echo "</pre>";
/* Check return code */
$ret= proc_close($process);
- if ($ret == 0){
-
- /* No error */
- $this->image_creation_log.="\n\nSuccessfull finished image creation.\n\n";
- } else {
-
- /* Error */
+ if ($ret != 0){
echo "<h1 style='color:red'>"._("Creating the image failed. Please see the report below.")."</h1>";
echo "<pre style='color:red'>$buffer</pre>";
echo "<h1 style='color:red'>"._("Creating the image failed. Please see the report below.")."</h1>";
echo "<pre style='color:red'>$buffer</pre>";
-
- $this->image_creation_log.="\n\nImage creation failed. Please see report below : \n\n";
- $this->image_creation_log.=$buffer."\n\n";
}
}
- echo $download_button."<br><br>";
echo $return_button."<br>";
} else {
echo $return_button."<br>";
} else {
}
/* Scroll down completly */
}
/* Scroll down completly */
- echo "<script language=\"javascript\" type=\"text/javascript\">scrollDown2();</script>" ;
- echo "</body></html>";
+ echo '<script language="javascript" type="text/javascript">scrollDown2();</script>' ;
+ echo '</body></html>';
flush();
exit;
}
flush();
exit;
}
- /******************
- FAI Image creation logfile requested
- ******************/
- if(isset($_GET['download_image_log'])){
-
- /* force download dialog */
- header("Content-type: application/tiff\n");
- if (preg_match('/MSIE 5.5/', $HTTP_USER_AGENT) ||
- preg_match('/MSIE 6.0/', $HTTP_USER_AGENT)) {
- header('Content-Disposition: filename="image.log"');
- } else {
- header('Content-Disposition: attachment; filename="image.log"');
- }
- header("Content-transfer-encoding: binary\n");
- header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
- header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
- header("Cache-Control: no-cache");
- header("Pragma: no-cache");
- header("Cache-Control: post-check=0, pre-check=0");
-
- echo $this->image_creation_log;
-
- exit();
- }
-
-
-
/********************
Change password ...
********************/
/********************
Change password ...
********************/