From: cajus Date: Fri, 22 Feb 2008 15:43:49 +0000 (+0000) Subject: Fixed loading of releases X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1cdea32e7abe6ab28b95f9aeefe653db4c56553c;p=gosa.git Fixed loading of releases git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9085 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/modules/SIPackages.pm b/gosa-si/modules/SIPackages.pm index 64c72c0a3..7812d63f6 100644 --- a/gosa-si/modules/SIPackages.pm +++ b/gosa-si/modules/SIPackages.pm @@ -786,7 +786,7 @@ sub new_ldap_config { # Perform search $mesg = $ldap->search( base => $ldap_base, scope => 'sub', - attrs => ['dn', 'gotoLdapServer', 'gosaUnitTag'], + attrs => ['dn', 'gotoLdapServer', 'gosaUnitTag', 'FAIclass'], filter => "(&(objectClass=GOhard)(macaddress=$macaddress))"); #$mesg->code && die $mesg->error; if($mesg->code) { @@ -811,12 +811,19 @@ sub new_ldap_config { my @ldap_uris; my $server; my $base; + my $release; + + # Fill release if available + my $FAIclass= $entry->get_value("FAIclass"); + if (defined $FAIclass && $FAIclass =~ /^.* :([A-Za-z0-9\/.]+).*$/) { + $release= $1; + } # Do we need to look at an object class? if (length(@servers) < 1){ $mesg = $ldap->search( base => $ldap_base, scope => 'sub', - attrs => ['dn', 'gotoLdapServer'], + attrs => ['dn', 'gotoLdapServer', 'FAIclass'], filter => "(&(objectClass=gosaGroupOfNames)(member=$dn))"); #$mesg->code && die $mesg->error; if($mesg->code) { @@ -833,6 +840,13 @@ sub new_ldap_config { $entry= $mesg->entry(0); $dn= $entry->dn; @servers= $entry->get_value("gotoLdapServer"); + + if (not defined $release){ + $FAIclass= $entry->get_value("FAIclass"); + if (defined $FAIclass && $FAIclass =~ /^.* :([A-Za-z0-9\/.]+).*$/) { + $release= $1; + } + } } @servers= sort (@servers); @@ -854,6 +868,9 @@ sub new_ldap_config { # Assemble data package my %data = ( 'ldap_uri' => \@ldap_uris, 'ldap_base' => $base, 'ldap_cfg' => \@ldap_cfg, 'pam_cfg' => \@pam_cfg,'nss_cfg' => \@nss_cfg ); + if (defined $release){ + $data{'release'}= $release; + } # Need to append GOto settings? if (defined $goto_admin and defined $goto_secret){ @@ -867,7 +884,7 @@ sub new_ldap_config { # Find admin base and department name $mesg = $ldap->search( base => $ldap_base, scope => 'sub', - attrs => ['dn', 'ou', 'FAIclass'], + attrs => ['dn', 'ou'], filter => "(&(objectClass=gosaAdministrativeUnit)(gosaUnitTag=$unit_tag))"); #$mesg->code && die $mesg->error; if($mesg->code) { @@ -889,12 +906,6 @@ sub new_ldap_config { $data{'unit_tag'}= $unit_tag; } - # Fill release if available - my $FAIclass= $entry->get_value("FAIclass"); - if (defined $FAIclass && $FAIclass =~ /^.* :([A-Za-z0-9\/.]+).*$/) { - $data{'release'}= $1; - } - # Unbind $mesg = $ldap->unbind;