Code

Fixed some typos
[gosa.git] / plugins / admin / fai / class_faiHookEntry.inc
index f9f6b5e080de10fefb2d4f6a8e9a664530b32fd3..a3ed1dfd62bf8f9b7bd829e6eac6af8f7fe11e53 100644 (file)
@@ -42,6 +42,9 @@ class faiHookEntry extends plugin
 
   function execute()
   {
+       /* Call parent execute */
+       plugin::execute();
+
     /* Fill templating stuff */
     $smarty     = get_smarty();
     $display = "";
@@ -57,16 +60,24 @@ class faiHookEntry extends plugin
         $this->FAIscript = $str;
       }
     }
-    $smarty->assign("tasks", $this->tasks);
+
+    $used_tasks = $this->parent->getUsedFAItask($this->cn);
+    $tasks = $this->tasks;
+    foreach($this->tasks as $id => $task){
+      if(in_array($task,$used_tasks)){
+        unset($tasks[$id]);
+      }
+    }
+    $smarty->assign("tasks", $tasks);
 
      /* Magic quotes GPC, escapes every ' " \, to solve some security risks
      * If we post the escaped strings they will be escaped again
      */
     foreach($this->attributes as $attrs){
       if(get_magic_quotes_gpc()){
-        $smarty->assign($attrs,stripslashes($this->$attrs));
+        $smarty->assign($attrs,htmlentities(stripslashes($this->$attrs)));
       }else{
-        $smarty->assign($attrs,($this->$attrs));
+        $smarty->assign($attrs,htmlentities($this->$attrs));
       }
     }
 
@@ -85,6 +96,7 @@ class faiHookEntry extends plugin
           $this->$attrs = "";
         }
       }
+      $this->FAIscript= recode("DOS..LATIN1", $this->FAIscript);
     }
   }