Handle logging when attr change from an empty value to soething else

master
Daniel Berteaud 4 years ago
parent 593c1f42d3
commit 09542e6b00
  1. 3
      zmldapsync/zmldapsync.pl

@ -357,6 +357,7 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) {
not defined $ext_users->{$user}->{$attr} ) { not defined $ext_users->{$user}->{$attr} ) {
# If the attribute doesn't exist in external LDAP, we must remove it from Zimbra. # If the attribute doesn't exist in external LDAP, we must remove it from Zimbra.
# Except for sn which is mandatory in 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} . " " . $attrs .= '-' . $conf->{domains}->{$domain}->{users}->{attr_map}->{$attr} . " " .
zim_attr_value( $zim_users->{$user}->{$conf->{domains}->{$domain}->{users}->{attr_map}->{$attr}} ); zim_attr_value( $zim_users->{$user}->{$conf->{domains}->{$domain}->{users}->{attr_map}->{$attr}} );
} elsif ( } elsif (
@ -370,7 +371,7 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) {
$attrs .= " " . $conf->{domains}->{$domain}->{users}->{attr_map}->{$attr} . " " . $attrs .= " " . $conf->{domains}->{$domain}->{users}->{attr_map}->{$attr} . " " .
zim_attr_value( $ext_users->{$user}->{$attr} ); zim_attr_value( $ext_users->{$user}->{$attr} );
log_verbose( "Attribute $attr for user $user changed from " . 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 " . " to " .
$ext_users->{$user}->{$attr} ); $ext_users->{$user}->{$attr} );
} }

Loading…
Cancel
Save