From 09542e6b002f7abf9918c3cc963ae85889840bef Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 8 Oct 2020 18:08:00 +0200 Subject: [PATCH] Handle logging when attr change from an empty value to soething else --- zmldapsync/zmldapsync.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zmldapsync/zmldapsync.pl b/zmldapsync/zmldapsync.pl index 7f236f2..618931e 100755 --- a/zmldapsync/zmldapsync.pl +++ b/zmldapsync/zmldapsync.pl @@ -357,6 +357,7 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) { not defined $ext_users->{$user}->{$attr} ) { # If the attribute doesn't exist in external LDAP, we must remove it from Zimbra. # Except for sn which is mandatory in Zimbra + log_verbose( "Attribute $attr for user $user removed from LDAP, removing it from Zimbra"); $attrs .= '-' . $conf->{domains}->{$domain}->{users}->{attr_map}->{$attr} . " " . zim_attr_value( $zim_users->{$user}->{$conf->{domains}->{$domain}->{users}->{attr_map}->{$attr}} ); } elsif ( @@ -370,7 +371,7 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) { $attrs .= " " . $conf->{domains}->{$domain}->{users}->{attr_map}->{$attr} . " " . zim_attr_value( $ext_users->{$user}->{$attr} ); log_verbose( "Attribute $attr for user $user changed from " . - $zim_users->{$user}->{$conf->{domains}->{$domain}->{users}->{attr_map}->{$attr}} . + ( $zim_users->{$user}->{$conf->{domains}->{$domain}->{users}->{attr_map}->{$attr}} || 'an empty value' ). " to " . $ext_users->{$user}->{$attr} ); }