Code

Fixed ppd path
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Jan 2006 15:40:49 +0000 (15:40 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Jan 2006 15:40:49 +0000 (15:40 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2471 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_printGeneric.inc
plugins/admin/systems/class_printerPPDDialog.inc

index a8843d920550ae492647e4e60614122cd63d7649..fc743ce969414ae6b89fe9511a60c69e73967518 100644 (file)
@@ -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", "<b>".sprintf(_("Your currently selected PPD file '%s' doesn't exist."),$this->gotoPrinterPPD))."</b>";
         }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"));
index 2f0c18f9db0913411bafb808f641e76c9495ed3f..f9f3ed2717412c8d9a8567df3639c8885488f3c4 100644 (file)
@@ -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 = "";
     }