Code

Made faiScript w3c conform
[gosa.git] / gosa-plugins / fai / admin / fai / class_faiVariable.inc
index f8f1b3be44483430aeca053dce72cf9e50cab267..0847d8842c3584d039447498b6a37c63d011f938 100644 (file)
@@ -65,7 +65,7 @@ class faiVariable extends plugin
   {
     if($dn == "new" || $dn == ""){
       if($this->dn == "new"){
-        $dn = session::get('CurrentMainBase');
+        $dn= $this->parent->parent->acl_base;
       }else{
         $dn = $this->dn;
       }
@@ -99,7 +99,7 @@ class faiVariable extends plugin
     }
 
     if($this->dn != "new"){
-      session::set('objectinfo',$this->dn);
+      set_object_info($this->dn);
     }
 
 
@@ -113,7 +113,7 @@ class faiVariable extends plugin
       $this->dialog->set_acl_base($c_dn);
       $this->dialog->FAIstate = $this->FAIstate;
       $this->dialog->parent = &$this;
-      session::set('objectinfo',$this->SubObjects[$var]['dn']);
+      set_object_info($this->SubObjects[$var]['dn']);
       $this->is_dialog=true;
     }
     
@@ -257,12 +257,12 @@ class faiVariable extends plugin
       $ldap = $this->config->get_ldap_link();
       $ldap->cd ($this->dn);
       $release = $this->parent->parent->fai_release;
-      $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+      $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn), '/')."/i", $release, $this->dn);
       new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
       FAI::prepare_to_save_FAI_object($use_dn,array(),true);
 
       foreach($this->SubObjects as $name => $obj){
-        $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
+        $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn), '/')."/i", $release, $obj['dn']);
         FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       }
       $this->handle_post_events("remove");
@@ -329,7 +329,7 @@ class faiVariable extends plugin
 
       $tmp = array();
       foreach($this->subAttributes as $attrs){
-        if($obj[$attrs] == ""){
+        if(!isset($obj[$attrs]) || $obj[$attrs] == ""){
           $obj[$attrs] = array();
         }
         $tmp[$attrs] = $obj[$attrs];