From 8a530e89025f2a89422bc592483321553c895735 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 12 Jan 2006 15:40:49 +0000 Subject: [PATCH] Fixed ppd path git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2471 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_printGeneric.inc | 12 +++++++++--- plugins/admin/systems/class_printerPPDDialog.inc | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index a8843d920..fc743ce96 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -358,12 +358,18 @@ class printgeneric extends plugin require_once ("class_ppdManager.inc"); if((isset($_SESSION['config']->data['MAIN']['PPD_PATH']))&&(is_dir($_SESSION['config']->data['MAIN']['PPD_PATH']))){ - $ppdManager= new ppdManager($_SESSION['config']->data['MAIN']['PPD_PATH']); + + $path = $_SESSION['config']->data['MAIN']['PPD_PATH']; + if(!preg_match("/\/$/",$path)){ + $path = $path."/"; + } + + $ppdManager= new ppdManager($path); if(!empty($this->gotoPrinterPPD)){ - if((!file_exists($_SESSION['config']->data['MAIN']['PPD_PATH'].$this->gotoPrinterPPD))){ + if((!file_exists($path.$this->gotoPrinterPPD))){ $smarty->assign("driverInfo", "".sprintf(_("Your currently selected PPD file '%s' doesn't exist."),$this->gotoPrinterPPD)).""; }else{ - $smarty->assign("driverInfo", $ppdManager->loadDescription($_SESSION['config']->data['MAIN']['PPD_PATH'].$this->gotoPrinterPPD)); + $smarty->assign("driverInfo", $ppdManager->loadDescription($path.$this->gotoPrinterPPD)); } }else{ $smarty->assign("driverInfo", _("not defined")); diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc index 2f0c18f9d..f9f3ed271 100644 --- a/plugins/admin/systems/class_printerPPDDialog.inc +++ b/plugins/admin/systems/class_printerPPDDialog.inc @@ -31,6 +31,9 @@ class printerPPDDialog extends plugin if(isset($_SESSION['config']->data['MAIN']['PPD_PATH'])){ $this->pathToPPD = $_SESSION['config']->data['MAIN']['PPD_PATH']; $this->pathToPPD= preg_replace("/\/\//", "/", $this->pathToPPD); + if(!preg_match("/\/$/",$this->pathToPPD)){ + $this->pathToPPD = $this->pathToPPD."/"; + } }else{ $this->pathToPPD = ""; } -- 2.30.2