From f200dd75f4416783f61c76f51b0d783c5140a650 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 6 Apr 2006 04:42:37 +0000 Subject: [PATCH] Encoded printer ppd name & category to ensure that also files with + are useable git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3000 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_printerPPDDialog.inc | 4 ++-- .../systems/class_printerPPDSelectionDialog.inc | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc index f8f9b35da..7f4669964 100644 --- a/plugins/admin/systems/class_printerPPDDialog.inc +++ b/plugins/admin/systems/class_printerPPDDialog.inc @@ -201,13 +201,13 @@ class printerPPDDialog extends plugin $hit = false; foreach($this->ppdList as $vendor => $ppds ){ foreach($ppds as $name => $ppd){ - if($ppd['link']==$_GET['id']){ + if($ppd['link']==base64_decode($_GET['id'])){ $hit = true; } } } if($hit == true){ - $this->selectedPPD['link'] = str_replace($this->pathToPPD,"",$_GET['id']); + $this->selectedPPD['link'] = str_replace($this->pathToPPD,"",base64_decode($_GET['id'])); $this->ppdConfig = false; } unset($this->dialog); diff --git a/plugins/admin/systems/class_printerPPDSelectionDialog.inc b/plugins/admin/systems/class_printerPPDSelectionDialog.inc index 1c949fb99..335c947b5 100644 --- a/plugins/admin/systems/class_printerPPDSelectionDialog.inc +++ b/plugins/admin/systems/class_printerPPDSelectionDialog.inc @@ -64,9 +64,15 @@ class printerPPDSelectionDialog extends plugin } } } - + if((isset($_GET['act']))&&($_GET['act']=="open")) { - $this->Vendor = $_GET['id']; + + if((!empty($_GET['id'])) && (!isset( $this->header[base64_decode($_GET['id'])]))){ + print_red(sprintf(_("Selected vendor '%s' does not exists in our list of ppds."),base64_decode($_GET['id']))); + $this->Vendor = ""; + }else{ + $this->Vendor = base64_decode($_GET['id']); + } } $div = new divSelectBox("printerPPDSelectionDialog"); @@ -80,7 +86,7 @@ class printerPPDSelectionDialog extends plugin if(empty($this->Vendor)){ foreach($this-> header as $key => $entry){ $div ->AddEntry (array( - array("string"=>sprintf($linkopen,$key,$key),"attach"=>"style='border-right:0px;'") + array("string"=>sprintf($linkopen,base64_encode($key),$key),"attach"=>"style='border-right:0px;'") )); } }else{ @@ -90,7 +96,7 @@ class printerPPDSelectionDialog extends plugin foreach($list as $key => $ppd){ if(preg_match("/^".$this->Vendor."/",$ppd['ppd'])){ $div ->AddEntry (array( - array("string"=>sprintf($uselink,$key,$ppd['ppd']),"attach"=>"style='border-right:0px;'") + array("string"=>sprintf($uselink,base64_encode($key),$ppd['ppd']),"attach"=>"style='border-right:0px;'") )); } } -- 2.30.2