Code

Updated post handling for fax classes
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 14 Jul 2010 13:27:08 +0000 (13:27 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 14 Jul 2010 13:27:08 +0000 (13:27 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19013 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc
gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc
gosa-plugins/gofax/gofax/faxreports/class_faxreport.inc

index ded4f54942034635a007d4343f9b1a9a96664ae8..512422938b2231a843e8850aa5dbbb35b5f87669 100644 (file)
@@ -132,7 +132,7 @@ class blocklistGeneric extends plugin
     $smarty = get_smarty();
 
     foreach($this->attributes as $name){
-      $smarty->assign($name,$this->$name);
+      $smarty->assign($name,set_post($this->$name));
     }
     $tmp = $this->plInfo();
     foreach($tmp['plProvidedAcls'] as $name => $translation){
@@ -145,12 +145,12 @@ class blocklistGeneric extends plugin
       $smarty->assign("goFaxBlocklistACL", $this->getacl('goFaxRBlocklist'));
     }
 
-    $smarty->assign("goFaxBlocklist",$this->goFaxBlocklist);
+    $smarty->assign("goFaxBlocklist", set_post($this->goFaxBlocklist));
     $smarty->assign("cnACL",$this->getacl("cn",$this->readonly));
     $smarty->assign("typeACL",$this->getacl("type",$this->readonly));
     $smarty->assign("base", $this->baseSelector->render());
     $smarty->assign("types", array(BLOCK_LIST_SEND => _("send"), BLOCK_LIST_RECEIVE => _("receive")));
-    $smarty->assign("type", $this->type);
+    $smarty->assign("type", set_post($this->type));
     $smarty->assign("dn", $this->dn);
     $smarty->assign("read_only",$this->read_only);
     return($smarty->fetch(get_template_path('generic.tpl', TRUE)));
@@ -182,7 +182,7 @@ class blocklistGeneric extends plugin
         if(in_array($attr,array("cn","type")) && $this->readonly){
           continue;
         }elseif(isset($_POST[$attr]) && $this->acl_is_writeable($attr)){
-          $this->$attr = $_POST[$attr];
+          $this->$attr = get_post($attr);
         }
       }
     }
@@ -312,7 +312,7 @@ class blocklistGeneric extends plugin
   function getCopyDialog()
   { 
     $smarty = get_smarty();
-    $smarty->assign("cn",$this->cn);
+    $smarty->assign("cn",set_post($this->cn));
     $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__)));
     $ret = array();
     $ret['string'] = $str;
index e4dff7992b660db0c178e2d22e0d7cb0c026b833..7b8ebebef2114a1855550c5e5cd7c835e38f39f1 100644 (file)
@@ -435,8 +435,7 @@ class gofaxAccount extends plugin
 
 
       /* Show dialog */
-      $smarty->assign("cblocklist", $this->current_blocklist);
-      $smarty->assign("departments", $this->config->idepartments);
+      $smarty->assign("cblocklist", set_post($this->current_blocklist));
       $smarty->assign("predefinedList", $this->predefinedList->render());
       $display.= $smarty->fetch (get_template_path('lists.tpl', TRUE, dirname(__FILE__)));
       return ($display);
@@ -516,8 +515,7 @@ class gofaxAccount extends plugin
       $this->predefinedList->update();
 
       /* Show dialog */
-      $smarty->assign("cblocklist", $this->current_blocklist);
-      $smarty->assign("departments", $this->config->idepartments);
+      $smarty->assign("cblocklist", set_post($this->current_blocklist));
       $smarty->assign("predefinedList", $this->predefinedList->render());
       $display.= $smarty->fetch (get_template_path('lists.tpl', TRUE, dirname(__FILE__)));
       return ($display);
@@ -526,16 +524,15 @@ class gofaxAccount extends plugin
 
     /* Show main page */
     $smarty->assign("languages", get_languages(TRUE));
-
-    $smarty->assign("formats",  $this->fax_formats);
-    $smarty->assign("printers", $this->printerList);
+    $smarty->assign("formats",  set_post($this->fax_formats));
+    $smarty->assign("printers", set_post($this->printerList));
 
     /* Load attributes */
     foreach(array("goFaxIsEnabled", "goFaxDeliveryMode", "facsimileTelephoneNumber",
           "goFaxPrinter", "goFaxLanguage", "goFaxFormat", 
           "facsimileAlternateTelephoneNumber", "mail") as $val){
 
-      $smarty->assign("$val", $this->$val);
+      $smarty->assign("$val", set_post($this->$val));
     }
 
     $tmp = $this->plInfo();
@@ -683,7 +680,7 @@ class gofaxAccount extends plugin
 
     
       if (isset($_POST['mail']) && $this->acl_is_writeable("faxtomail",$edit_mode)){
-        $this->mail= $_POST['mail'];
+        $this->mail= get_post('mail');
       }
 
       /* Check if mail account is active and correct the internal
@@ -790,7 +787,7 @@ class gofaxAccount extends plugin
   {
     $str    = "";
     $smarty = get_smarty();
-    $smarty->assign("facsimileTelephoneNumber", $this->facsimileTelephoneNumber);
+    $smarty->assign("facsimileTelephoneNumber", set_post($this->facsimileTelephoneNumber));
     $str['string']   = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__)));
     $str['status'] ="";
     return($str);
@@ -799,7 +796,7 @@ class gofaxAccount extends plugin
   function SaveCopyDialog()
   {
     if(isset($_POST['facsimileTelephoneNumber'])){
-      $this->facsimileTelephoneNumber = $_POST['facsimileTelephoneNumber'];
+      $this->facsimileTelephoneNumber = get_post('facsimileTelephoneNumber');
     }
   }
 
@@ -877,7 +874,7 @@ class gofaxAccount extends plugin
           $this->goFaxIsEnabled= "1";
         }
       if (isset($_POST['mail']) && in_array("mail",$this->multi_boxes)){
-        $this->mail= $_POST['mail'];
+        $this->mail= get_post('mail');
       }
     }
   }
index ee78cb718edd212c6d38b86ec3548dd085e75115..cbbbcfcab72c369639d46449b7f3f79f4255838b 100644 (file)
@@ -106,7 +106,7 @@ class faxreport extends plugin
 
         // Set smarty defaults  
         $smarty= get_smarty();
-        $smarty->assign("search_for"           , $this->search_for);
+        $smarty->assign("search_for"           , set_post($this->search_for));
         $smarty->assign("months"                         , $months);
         $smarty->assign("month_select" , $this->month);
         $smarty->assign("years"                                  , $years);
@@ -194,15 +194,15 @@ class faxreport extends plugin
                 $final="fax_$vname";
                 $v_acl = $this->ui->get_permissions($dn,"users/viewFaxEntries",preg_replace("/_/","",$vname));
                 if($line[$vname] != "" && preg_match("/r/i", $v_acl)){
-                    $smarty->assign("$final", $line[$vname]);
+                    $smarty->assign("$final", set_post($line[$vname]));
                 } else {
                     $smarty->assign("$final", "-");
                 }
             }
             $format= _("Y-M-D");
             $queuing_time= $line['queuing_time'];
-            $smarty->assign("plug", "?plug=".validate($_GET['plug']));
-            $smarty->assign("detail", validate($detail));
+            $smarty->assign("plug", "?plug=".get_post('plug'));
+            $smarty->assign("detail", set_post(get_post($detail)));
             $date= preg_replace("/Y/", substr($queuing_time,0,4), $format);
             $date= preg_replace("/M/", substr($queuing_time,4,2), $date);
             $date= preg_replace("/D/", substr($queuing_time,6,2), $date);
@@ -384,7 +384,7 @@ class faxreport extends plugin
     {
         $faxreportfilter = session::get("faxreportfilter");
         if(isset($_POST['EntriesPerPage'])){
-            $this->range = $_POST['EntriesPerPage'];
+            $this->range = get_post('EntriesPerPage');
         }
 
         if (isset($_GET['start'])){
@@ -407,7 +407,7 @@ class faxreport extends plugin
         }
         foreach( array("year", "month", "search_for") as $type){
             if (isset($_POST[$type])){
-                $faxreportfilter[$type]= $_POST[$type];
+                $faxreportfilter[$type]= get_post($type);
 
                 /* reset start page, if filter has changed */ 
                 if(!isset($_GET['start'])){