Code

Updated workstation - Startup
[gosa.git] / plugins / admin / systems / class_printerPPDDialog.inc
index 78929670c7f1c277a06507fc056ac3d4e5f62ab4..a93e91bb4e56ad2a40d99cafcc41e6827d0e57c3 100644 (file)
@@ -290,17 +290,14 @@ class printerPPDDialog extends plugin
             print_red(sprintf(_("Can't add new ppd file, the source file '%s' is not accessible."),$_PathOnHdd));         
           }else{
             $this->add_ppd_later = $_PathOnHdd."_back";
-            $this->add_later_msg_dialog = new msg_dialog(_("PPD file already exists"),
-                _("There is already a ppd file for this kind of printer."),CONFIRM_DIALOG);
+            $this->add_later_msg_dialog = new msg_dialog(_("Overwrite existing PPD"),
+                _("There is already a ppd file for this kind of printer. Do you want to overwrite it?"),CONFIRM_DIALOG);
           }
           return;
         }
       }
     }
 
-    /* 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))){
@@ -309,6 +306,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));
@@ -339,7 +339,7 @@ class printerPPDDialog extends plugin
   function getPrinterReload()
   {
     if(is_readable($this->pathToPPD)){
-      $tmp = $this->ppdManager->getPrinterList(true);
+      $tmp = @$this->ppdManager->getPrinterList(true);
 
       $this->ppdListHeader = $this->ppdList = array();