From: hickert Date: Thu, 12 Jan 2006 08:42:57 +0000 (+0000) Subject: Fixed ppd selection X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d1210d5c2d38f6959d0483c561767b3c5bacf1bc;p=gosa.git Fixed ppd selection git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2454 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc index 516f95ad0..2f0c18f9d 100644 --- a/plugins/admin/systems/class_printerPPDDialog.inc +++ b/plugins/admin/systems/class_printerPPDDialog.inc @@ -30,7 +30,7 @@ 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); + $this->pathToPPD= preg_replace("/\/\//", "/", $this->pathToPPD); }else{ $this->pathToPPD = ""; } @@ -151,8 +151,6 @@ class printerPPDDialog extends plugin $tmp3['link'] =$ppdname; $tmp3['ppd'] =$res; - print_a($tmp3); - $this->selectedPPD = $tmp3; $this->getPrinterReload(); } @@ -204,11 +202,14 @@ class printerPPDDialog extends plugin $hit = true; } } - } - $this->selectedPPD['link'] = $_GET['id']; - $this->ppdConfig = false; + } + if($hit == true){ + $this->selectedPPD['link'] = str_replace($this->pathToPPD,"",$_GET['id']); + $this->ppdConfig = false; + } unset($this->dialog); $this->dialog=NULL; + } /* if a dialog is open, print the dialog instead of this class @@ -257,7 +258,9 @@ class printerPPDDialog extends plugin } function save_ppd(){ - $this->ppdManager->saveProperties($this->pathToPPD.$this->selectedPPD['link'],$this->ppdConfig); + if($this->ppdManager){ + $this->ppdManager->saveProperties($this->pathToPPD.$this->selectedPPD['link'],$this->ppdConfig); + } } /* Save to LDAP */ @@ -274,7 +277,7 @@ class printerPPDDialog extends plugin */ $str = "none"; if(!empty($this->selectedPPD)){ - $str = $this->ppdManager->loadDescription($this->pathToPPD.$this->selectedPPD['link']); + $str = $this->ppdManager->loadDescription($this->pathToPPD."/".$this->selectedPPD['link']); } return($str) ; }