From: hickert Date: Mon, 8 May 2006 09:27:54 +0000 (+0000) Subject: Added cn to ppd name X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=53688036d68fc1e90e2961cf2e1962b700d940f5;p=gosa.git Added cn to ppd name git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3216 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc index 7f4669964..7d862b121 100644 --- a/plugins/admin/systems/class_printerPPDDialog.inc +++ b/plugins/admin/systems/class_printerPPDDialog.inc @@ -9,7 +9,7 @@ class printerPPDDialog extends plugin /* attribute list for save action */ var $ignore_account = TRUE; - var $attributes = array(); + var $attributes = array("cn"); var $objectclasses = array("whatever"); var $ppdList = array(); // Contains all Printer models @@ -22,6 +22,7 @@ class printerPPDDialog extends plugin var $ppdConfig = false; // $this->ppdManager->loadProperties($this->selectedPPD['link']); var $pathToPPD = ""; + var $cn; function printerPPDDialog ($config, $dn= NULL,$ppdfile=NULL ) { @@ -139,9 +140,10 @@ class printerPPDDialog extends plugin } }// Foreach if(!$found){ - $ppdname = $vendor."/".$vendor."-".preg_replace("/^[^ ]/","",str_replace("-","",$model)).".ppd"; - $filename = $this->pathToPPD.$vendor."/".$vendor."-".preg_replace("/^[^ ]/","",str_replace("-","",$model)).".ppd"; - $fp = @fopen($filename,"w+"); + $printerName = $this->cn."-".$vendor."-".preg_replace("/^[^ ]/","",str_replace("-","",$model)); + $ppdname = $vendor."/".$printerName.".ppd"; + $filename = $this->pathToPPD.$ppdname; + $fp = fopen($filename,"w+"); if(!$fp){ print_red(sprintf(_("Can't save file '%s'."),$filename)); }else{ @@ -149,8 +151,10 @@ class printerPPDDialog extends plugin fputs($fp,$str); @fclose($fp); + $this->ppdManager->updateAttribute($filename,"NO_SECTION","ModelName",$printerName); + $tmp2= split("\n", $res); - $tmp3['name'] =preg_replace("/^ -/","",$tmp2[1]); + $tmp3['name'] =preg_replace("/ */","",preg_replace("/^ -/","",$tmp2[1])); $tmp3['link'] =$ppdname; $tmp3['ppd'] =$res; @@ -352,12 +356,12 @@ class printerPPDDialog extends plugin if(($type == "PickOne")||(($type=="Boolean")&&(count($values)>1))){ $str .= "\n";