Code

Updated Post handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 14 Jul 2010 08:51:26 +0000 (08:51 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 14 Jul 2010 08:51:26 +0000 (08:51 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19008 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc
gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc

index 2c6b5249ed9389196f33412e28fb3793e94609d3..f2caa10e3386bc3e2ef96325b22dce90ebf831b3 100644 (file)
@@ -106,7 +106,6 @@ class macro extends plugin
     }
 
     /* Variables */
-    $vars      = "";
     $tmp       = array();
     $number = 0; 
 
@@ -128,14 +127,11 @@ class macro extends plugin
 
     /* Assign all vars to Smarty */
     foreach($this->attributes as $ar){
-      $smarty->assign($ar, $this->$ar);
+      $smarty->assign($ar, set_post($this->$ar));
     }
 
     $smarty->assign("base", $this->baseSelector->render());
 
-    /* Checkboxes */
-    $smarty->assign("vars", $vars);
-
     if($this->goFonMacroVisible){
       $smarty->assign("goFonMacroVisibleChecked"," checked ");
     }else{
@@ -143,10 +139,10 @@ class macro extends plugin
     }
 
     $smarty->assign("cnACL",$this->getacl("cn",$this->initially_was_account));
-    $smarty->assign("cn",$this->cn);
+    $smarty->assign("cn",set_post($this->cn));
 
     /* Ensure that macro content is displayed correctly encoded */
-    $smarty->assign("goFonMacroContent",htmlentities(utf8_decode ($this->goFonMacroContent)));
+    $smarty->assign("goFonMacroContent",set_post($this->goFonMacroContent));
 
     /* Show main page */
     return($smarty->fetch (get_template_path('generic.tpl', TRUE)));
@@ -552,7 +548,7 @@ class macro 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));
     $ret = array();
     $ret['string'] = $str;
@@ -564,7 +560,7 @@ class macro extends plugin
   function saveCopyDialog()
   {
     if(isset($_POST['cn'])){
-      $this->cn = $_POST['cn'];
+      $this->cn = get_post('cn');
     }
   }
 
index b93b966558b2a4e093b118ce5920dd8ad7b6e283..7f65532eae79568ae05661416dab3a63143fc238 100644 (file)
@@ -247,9 +247,9 @@ class macroParameter extends plugin
         $vars .="<tr>
           <td>
             <input name=\"number".$key."\" value='".$key."' type='hidden' ".$disabled.">
-            <input name='var".$key."' type='hidden'   value='".$para['var']."' ".$disabled.">ARG".$key."
+            <input name='var".$key."' type='hidden'   value='".set_post($para['var'])."' ".$disabled.">ARG".$key."
           </td>
-          <td><input type='text' name='varname".$key."'  value='".$para['name']."' ".$disabled."></td>
+          <td><input type='text' name='varname".$key."'  value='".set_post($para['name'])."' ".$disabled."></td>
           <td>
             <select size=1 name='vartype".$key."'  ".$disabled.">
               <option  value='string' ".$sel1.">"._("String")."&nbsp;</option>
@@ -257,7 +257,7 @@ class macroParameter extends plugin
               <option  value='bool'   ".$sel3.">"._("Bool")."&nbsp;</option>
             </select>
           </td>
-          <td><input type='text' name='default".$key."'   value='".$para['default']."'  ".$disabled."></td>
+          <td><input type='text' name='default".$key."'   value='".set_post($para['default'])."'  ".$disabled."></td>
           <td>&nbsp;";
         if($para['check']==false) {
           $vars.="<button type='submit' name='del".$key."'>"._("Delete unused")."</button>";
@@ -311,12 +311,12 @@ class macroParameter extends plugin
       }elseif(preg_match("/^number/",$name)){
 
         /* Set Post vars */
-        $key = $_POST[$name];
+        $key = get_post($name);
     
-        $this->goFonMacroParameter[$key]['var']   = $_POST["var".$key];
-        $this->goFonMacroParameter[$key]['name']   = $_POST["varname".$key];
-        $this->goFonMacroParameter[$key]['type']   = $_POST["vartype".$key];
-        $this->goFonMacroParameter[$key]['default']= $_POST["default".$key];
+        $this->goFonMacroParameter[$key]['var']    = get_post("var".$key);
+        $this->goFonMacroParameter[$key]['name']   = get_post("varname".$key);
+        $this->goFonMacroParameter[$key]['type']   = get_post("vartype".$key);
+        $this->goFonMacroParameter[$key]['default']= get_post("default".$key);
       }
     }