From 7c37c312b0843875456ed5c1e7b0dd355902e514 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 20 Jan 2014 10:27:02 +0100 Subject: [PATCH] Also update LDAP email address if the order has changed (at least if the first address of the list is not the same) --- root/etc/e-smith/events/actions/update-ldap-pseudonyms | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/root/etc/e-smith/events/actions/update-ldap-pseudonyms b/root/etc/e-smith/events/actions/update-ldap-pseudonyms index aa2ccf3..8fba291 100644 --- a/root/etc/e-smith/events/actions/update-ldap-pseudonyms +++ b/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 => {