Code

Added function (svn sync of death).
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 Mar 2008 15:53:00 +0000 (15:53 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 Mar 2008 15:53:00 +0000 (15:53 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9686 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-server

index dfa840aa8ef762125c8045d856e549516d7f3ffd..fdcb31b3686dc60a52fc9efa4f91404f0cd1b120 100755 (executable)
@@ -1890,6 +1890,40 @@ sub apply_fai_inheritance {
        return $fai_classes;
 }
 
+sub get_fai_release_entries {
+       my $tmp_classes = shift || return;
+       my $parent = shift || "";
+       my @result = shift || ();
+
+       foreach my $entry (keys %{$tmp_classes}) {
+               if(defined($entry)) {
+                       if($entry =~ /^ou=.*$/) {
+                               my $release_name = $entry;
+                               $release_name =~ s/ou=//g;
+                               if(length($parent)>0) {
+                                       $release_name = $parent."/".$release_name;
+                               }
+                               my @bufentries = get_fai_release_entries($tmp_classes->{$entry}, $release_name, @result);
+                               foreach my $bufentry(@bufentries) {
+                                       push @result, $bufentry;
+                               }
+                       } else {
+                               my @types = get_fai_types($tmp_classes->{$entry});
+                               foreach my $type (@types) {
+                                       push @result, 
+                                       {
+                                               'class' => $entry,
+                                               'type' => $type->{'type'},
+                                               'release' => $parent,
+                                               'state' => $type->{'state'},
+                                       };
+                               }
+                       }
+               }
+       }
+
+       return @result;
+}
 
 sub deep_copy {
        my $this = shift;