diff --git a/root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/007default b/root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/007default index 3eca654..f69c44c 100644 --- a/root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/007default +++ b/root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/007default @@ -55,10 +55,15 @@ $conf->{'locationRules'}->{"sso-manager.$domain"} = { } unless ($conf->{'locationRules'}->{"sso-manager.$domain"}); # Add default exported var -$conf->{'exportedVars'}->{'mail'} = 'preferredMail' if ($conf->{'exportedVars'}->{'mail'} eq 'mail'); -$conf->{'exportedVars'}->{'extension'} = 'extensionNumber' unless ($conf->{'exportedVars'}->{'extension'}); -$conf->{'exportedVars'}->{'nom'} = 'sn' unless ($conf->{'exportedVars'}->{'nom'}); -$conf->{'exportedVars'}->{'prenom'} = 'givenName' unless ($conf->{'exportedVars'}->{'prenom'}); +$conf->{'ldapExportedVars'}->{'mail'} = 'preferredMail' if ($conf->{'ldapExportedVars'}->{'mail'} eq 'mail'); +$conf->{'ldapExportedVars'}->{'extension'} = 'extensionNumber' unless ($conf->{'ldapExportedVars'}->{'extension'}); +$conf->{'ldapExportedVars'}->{'nom'} = 'sn' unless ($conf->{'ldapExportedVars'}->{'nom'}); +$conf->{'ldapExportedVars'}->{'prenom'} = 'givenName' unless ($conf->{'ldapExportedVars'}->{'prenom'}); + +# Remove obsolete exportedVars +foreach my $var (qw(mail nom prenom extension)){ + delete $conf->{'exportedVars'}->{$var} if $conf->{'exportedVars'}->{$var}; +} # Initialize a random key $conf->{'key'} = join( '', map { chr( int( rand(94) ) + 33 ) } ( 1 .. 16 ) ) unless ($conf->{'key'});