Code

Fixed snapshot generation to include all objects.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 20 Jun 2006 11:36:57 +0000 (11:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 20 Jun 2006 11:36:57 +0000 (11:36 +0000)
Only gosaDepartment && FAIclass will be skipped .

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3834 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_ldap.inc
include/class_plugin.inc

index 13da40948e31f36d373bc416cc6cc576b56dea0c..71fcbb756796bd1ab80b1b5a701ded6e565f4f6b 100644 (file)
@@ -797,7 +797,7 @@ class LDAP{
   }
 
 
-  function gen_ldif ($dn, $filter= "(objectClass=*)", $attributes= array('*'), $recursive= TRUE,$first = true)
+  function gen_ldif ($dn, $filter= "(objectClass=*)", $attributes= array('*'), $recursive= TRUE)
   {
     $display= "";
 
@@ -806,20 +806,13 @@ class LDAP{
       $this->ls($filter,$dn, array('dn','objectClass'));
       $deps = array();
 
-      if($first){
-        $display .= $this->gen_one_entry($dn)."\n";
-      }
+      $display .= $this->gen_one_entry($dn)."\n";
 
       while ($attrs= $this->fetch()){
-        $display.= $this->gen_one_entry($attrs['dn'], $filter, $attributes);
-        $display.= "\n";
-
-        if(in_array("organizationalUnit",$attrs['objectClass'])){
-          $deps[] = $attrs['dn'];
-        }
+        $deps[] = $attrs['dn'];
       }
       foreach($deps as $dn){
-        $display .= $this->gen_ldif($dn, $filter,$attributes,$recursive,false);
+        $display .= $this->gen_ldif($dn, $filter,$attributes,$recursive);
       }
     } else {
       $display.= $this->gen_one_entry($dn);
index 1b0e3837d319d397fcef08139bffee6f1511feb0..66b13f7d414888e8a4ea43bb286d80fb0bf5162c 100644 (file)
@@ -1024,7 +1024,7 @@ class plugin
 
       /* Create object */
       #$data             = preg_replace('/^dn:.*\n/', '', $ldap->gen_ldif($this->dn,"(!(objectClass=gosaDepartment))"));
-      $data             = $ldap->gen_ldif($this->dn,"(!(objectClass=gosaDepartment))");
+      $data             = $ldap->gen_ldif($this->dn,"(&(!(objectClass=gosaDepartment)(!(objectClass=FAIclass)))");
       $newName          = preg_replace("/\./", "", $sec."-".$usec);
       $target= array();
       $target['objectClass']            = array("top", "gosaSnapshotObject");