From d1b743e42be41d7d6c9a34c296a5199eb802ceca Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 15 Oct 2007 13:58:47 +0000 Subject: [PATCH] Fixed printer ppd upload for 2.5 git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7557 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_printerPPDDialog.inc | 38 +------------------ 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc index 0bfc33a81..39e72923c 100644 --- a/plugins/admin/systems/class_printerPPDDialog.inc +++ b/plugins/admin/systems/class_printerPPDDialog.inc @@ -22,14 +22,6 @@ class printerPPDDialog extends plugin var $cn = "" ; // Used to tag the ppds modified by the printer object, var $dialog = NULL; // Contains sub dialogs - /* If there is already a ppd file for the same type of printer, - * remember the path to ppd file and display a dialog which allows - * to overwrite the current ppd file. - */ - var $add_ppd_later = ""; - var $add_later_msg_dialog = NULL; - - function printerPPDDialog ($config, $dn= NULL,$ppdfile=NULL ) { plugin::plugin ($config, $dn); @@ -120,15 +112,6 @@ class printerPPDDialog extends plugin } } - /* Overwrite existing PPD file and select it as currently used for this object */ - if(is_object($this->add_later_msg_dialog) && ($this->add_later_msg_dialog->is_confirmed()) && $this->add_ppd_later != ""){ - if($name = $this->AddPPD($this->add_ppd_later,TRUE)){ - $this->SelectPPD($name); - } - $this->add_ppd_later = ""; - $this->add_later_msg_dialog = NULL; - } - /* Open a dialog that allow us to select different PPDs */ if(isset($_POST['SelectPPD'])){ $this->dialog= new printerPPDSelectionDialog($this->config,$this->dn,$this->ppdList,$this->ppdListHeader,$this->selectedPPD); @@ -240,7 +223,7 @@ class printerPPDDialog extends plugin /* This function adds a new ppd file to the list of available ppds. All required paths and files will be created $_PathOnHdd e.g. = /tmp/PHP_tmpfile213452 */ - function AddPPD($_PathOnHdd,$overwrite = FALSE) + function AddPPD($_PathOnHdd) { /* Check if file exists && is readable */ if((!is_file($_PathOnHdd)) || (!is_readable($_PathOnHdd))){ @@ -277,25 +260,6 @@ class printerPPDDialog extends plugin $filename = $this->pathToPPD.$ppdname; $contents = file_get_contents($_PathOnHdd); - - /* Check if this ppd already exists */ - $found = false; - foreach($this->ppdList[$vendor] as $key => $val){ - if(preg_match("/".$model.".*/i",$key)){ - $found = true; - if(!$overwrite){ - if(!copy($_PathOnHdd,$_PathOnHdd."_back")){ - 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); - } - return; - } - } - } - /* Open file handle */ $fp = fopen($filename,"w+"); -- 2.30.2