Code

Encoded printer ppd name & category to ensure that also files with + are useable
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Apr 2006 04:42:37 +0000 (04:42 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Apr 2006 04:42:37 +0000 (04:42 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3000 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_printerPPDDialog.inc
plugins/admin/systems/class_printerPPDSelectionDialog.inc

index f8f9b35da0df72a368d848533cadd6fab5014c9b..7f46699647efc04b2a4d2d58499f21d481c5d3c2 100644 (file)
@@ -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);
index 1c949fb99ddf5015a3671e3ec3c9758595d244be..335c947b56f4d31e81322bb4f79b9b10e6cb28fe 100644 (file)
@@ -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;'")
                 ));
         }
       }