diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc
index 6a9c37df63c2872f1e1331a823f0a2f58b6c4ccb..cf36067aea6df1c7f85fb229b9c6cd0ec5a1461d 100644 (file)
$this->ppdList[$vendor] = array();
}
- /* Check if this ppd already exists */
- $found = false;
- foreach($this->ppdList[$vendor] as $key => $val){
- if(preg_match("/".$model.".*/i",$key)){
- $found = true;
- print_red(sprintf(_("There is already a ppd file for this kind of printer.")));
- return;
- }
- }
+ /* Create ppd file and fill in the source contents */
+ $ppdname = $vendor."/".$name.".ppd";
+ $filename = $this->pathToPPD.preg_replace("/[^a-z0-9-_\.\/]/i","_",$ppdname);
+ $filename = $this->pathToPPD.$ppdname;
+ $contents = file_get_contents($_PathOnHdd);
/* Create the vendors path, if it doesn't exists already */
if(!is_dir($this->pathToPPD.$vendor)){
}
}
- /* Create ppd file and fill in the source contents */
- $ppdname = $vendor."/".$name.".ppd";
- $filename = $this->pathToPPD.$ppdname;
+ /* Open file handle */
$fp = fopen($filename,"w+");
- $contents = file_get_contents($_PathOnHdd);
/* Check file handle & contents */
if(!$fp){
function getPrinterReload()
{
if(is_readable($this->pathToPPD)){
- $tmp = $this->ppdManager->getPrinterList(true);
+ $tmp = @$this->ppdManager->getPrinterList(true);
$this->ppdListHeader = $this->ppdList = array();
/* Save modified ppd */
- function save_ppd(){
+ function save_ppd()
+ {
if($this->ppdManager){
$this->ppdManager->saveProperties($this->pathToPPD.$this->pathToModified.$this->selectedPPD['link'],$this->ppdConfig);
}
print_red(sprintf(_("Removing old ppd file '%s' failed. File does not exists or is not accessible."),$path));
}
}
+
+ function update_ppd_url()
+ {
+ $this->SelectPPD("modified/".$this->selectedPPD['link']);
+ return("modified/".$this->selectedPPD['link']);
+ }
function check()
{