Code

What about saving the entries?
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Apr 2008 14:23:10 +0000 (14:23 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Apr 2008 14:23:10 +0000 (14:23 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10119 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiPackage.inc

index d76d2dd78824ab3f3af4ee5214a17708b1e99ad7..8b1744ebd6928cbfaebfd7a9b1bd8e570900a24a 100644 (file)
@@ -471,17 +471,20 @@ class faiPackage extends plugin
     }
 
     FAI::prepare_to_save_FAI_object($this->dn,$this->attrs);
-    if (!$ldap->success()){
-      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
-    }
-    
+    $ldap->cd($this->dn);
+
     if($this->initially_was_account){
       new log("modify","fai/".get_class($this),$this->dn,$this->attributes);
+      $ldap->modify($this->attrs);
     }else{
       new log("create","fai/".get_class($this),$this->dn,$this->attributes);
+      $ldap->add($this->attrs);
     }
 
-    $ldap->cd($this->dn);
+    if (!$ldap->success()){
+      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
+    }
+    
 
     /* Save Package configurations */
     foreach($this->ConfiguredPackages as $pkgname => $attrs){
@@ -502,8 +505,8 @@ class faiPackage extends plugin
         $pkgattrs['FAIvariableContent']   = $attr['Value'];
         $pkgdn =  "FAIvariable=".$name.",".$this->dn;
 
-       /* Tag object */
-       $this->tag_attrs($pkgattrs, $pkgdn, $this->gosaUnitTag);
+        /* Tag object */
+        $this->tag_attrs($pkgattrs, $pkgdn, $this->gosaUnitTag);
 
         if(in_array($pkgattrs['FAIvariableType'],array("boolean","multiselect","password","select","string","text"))){
           FAI::prepare_to_save_FAI_object($pkgdn,$pkgattrs);