Also update LDAP email address if the order has changed (at least if the first address of the list is not the same)

tags/ipasserelle-base-0.2.65-1
Daniel Berteaud 11 years ago
parent eeac7aae1d
commit d4bd4233e6
  1. 4
      root/etc/e-smith/events/actions/update-ldap-pseudonyms

@ -137,10 +137,12 @@ foreach my $acct (@accounts){
foreach my $entry ($result->all_entries()){
push @mails, $entry->get_value('mail');
}
my $oldfirst = $mails[0];
my $newfirst = $alias[0];
my $alias = join('\0', sort @alias);
my $mails = join('\0', sort @mails);
unless ($alias eq $mails){
if (($alias ne $mails) or ($oldfirst ne $newfirst)){
$result = $ldap->modify(
"$dn=$key,ou=$ou,$base",
replace => {

Loading…
Cancel
Save