X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_systemManagement.inc;h=3f376951e09d57f4f79ce32096734a66a163ab26;hb=14a1125842be8515bd8b8f7117081e00f40470b5;hp=19759d55b6f8cb93209bcd640e34619795438ac2;hpb=5968d8b031057ae89dbb12ac0b734b5e4c7f82ad;p=gosa.git diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index 19759d55b..3f376951e 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -39,7 +39,6 @@ class systems extends plugin var $ui= NULL; var $acl= ""; var $DivListSystem; - var $image_creation_log =""; function systems ($config, $ui) { @@ -240,85 +239,60 @@ class systems extends plugin 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 = "". - "". - _("Use this link to download the logfile").""; - - $return_button = " ". - " ". - _("Back to work").""; + $return_button = "
+ + +
"; $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 */ - echo ' - '; - echo ""; - echo ""; - echo " - -
";
+        echo '  
+                
+                  
+                    
+                    
+                    
+                  
+                  
+                  
';
 
         /* Open process handle and check if it is a valid process */
-        $process= proc_open($command, $dsc, $pipes, '/tmp');
+        $process= proc_open($command." '".$this->dn."'", $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);
-            $this->image_creation_log .= $cur_dat;
             echo $cur_dat;
-            echo "" ;
+            echo '' ;
             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 "
"; /* 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 "

"._("Creating the image failed. Please see the report below.")."

"; echo "
$buffer
"; - - $this->image_creation_log.="\n\nImage creation failed. Please see report below : \n\n"; - $this->image_creation_log.=$buffer."\n\n"; } - echo $download_button."

"; echo $return_button."
"; } else { @@ -327,40 +301,13 @@ Object-dn : ".$this->dn." } /* Scroll down completly */ - echo "" ; - echo ""; + echo '' ; + echo ''; 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 ... ********************/ @@ -709,7 +656,7 @@ Object-dn : ".$this->dn." $responsible= array(); foreach ($this->config->departments as $key => $value){ if (get_module_permission(get_permissions ($value, $this->ui->subtreeACL), - "terminal", $value) == "#all#"){ + "systems", $value) != ""){ $responsible[$key]= $value; } } @@ -751,14 +698,14 @@ Object-dn : ".$this->dn." if($this->DivListSystem->$checkBox){ if($this->DivListSystem->SubSearch){ if($oc['CLASS'] != ""){ - $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))"; + $filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))"; $res = array_merge($res,get_list($filter,$this->ui->subtreeACL, $base, array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE | GL_SUBSEARCH | GL_SIZELIMIT)); } }else{ /* User filter? */ if($oc['CLASS'] != ""){ - $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))"; + $filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))"; $res = array_merge($res,get_list($filter,$this->ui->subtreeACL, $oc['TREE'].$base, array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE | GL_SIZELIMIT)); }