Code

w3c
[gosa.git] / plugins / admin / fai / class_faiScript.inc
index 9885b5cfacca92570aeb4b3cb632263736543a25..bd2ebf893b2aef9c60421eac6f799f9d3a808ab1 100644 (file)
@@ -71,16 +71,20 @@ class faiScript extends plugin
           $this->SubObjects[$object['cn'][0]][$attrs]=addslashes($this->SubObjects[$object['cn'][0]][$attrs]);
         }
 
-        $this->SubObjects[$object['cn'][0]]['FAIscript']   = $this->readBinary("FAIscript",$object['dn']);
+        $this->SubObjects[$object['cn'][0]]['FAIscript']   = addslashes ($this->readBinary("FAIscript",$object['dn']));
  
         $this->SubObjects[$object['cn'][0]]['status']      = "edited";
         $this->SubObjects[$object['cn'][0]]['dn']          = $object['dn'];
       }
+      ksort($this->SubObjects);
     }
   }
 
   function execute()
   {
+       /* Call parent execute */
+       plugin::execute();
+
     /* Fill templating stuff */
     $smarty= get_smarty();
     $display= "";
@@ -91,7 +95,11 @@ class faiScript extends plugin
       $this->is_dialog=true;
     }
 
-    $_SESSION['objectinfo'] = $this->dn;
+    if($this->dn != "new"){
+      $_SESSION['objectinfo']= $this->dn;
+    }
+
+
     /* Edit selected Sub Object */
     if((isset($_POST['EditSubObject']))&&(isset($_POST['SubObject']))){
       $this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$_POST['SubObject']]);
@@ -134,6 +142,7 @@ class faiScript extends plugin
         unset($this->dialog);
         $this->dialog=NULL;
       }
+    ksort($this->SubObjects);
     }
 
     /* Cancel Dialog */