Code

Fixed PPD upload if vendor directory wasn't created.
[gosa.git] / plugins / admin / systems / class_printerPPDDialog.inc
index b2e8819c301b30eac5a76c7c7d46c70e98d997eb..ac3aebc5965d3ace0966d0e82a39d14ff8b9d0d2 100644 (file)
@@ -260,9 +260,6 @@ class printerPPDDialog extends plugin
     $filename     = $this->pathToPPD.$ppdname;
     $contents     = file_get_contents($_PathOnHdd);
 
-    /* Open file handle */
-    $fp           = fopen($filename,"w+");
-
     /* Create the vendors path, if it doesn't exists already */
     if(!is_dir($this->pathToPPD.$vendor)){
       if(!(@mkdir($this->pathToPPD.$vendor))){
@@ -271,6 +268,9 @@ class printerPPDDialog extends plugin
       }
     }
   
+    /* Open file handle */
+    $fp           = fopen($filename,"w+");
+
     /* Check file handle & contents */
     if(!$fp){
       print_red(sprintf(_("Can't save file '%s'."),$filename));