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 0.2.41_el6
Daniel Berteaud 11 years ago
parent df913714dd
commit 7c37c312b0
  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