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

This commit is contained in:
Daniel Berteaud 2020-10-08 18:08:00 +02:00
parent 593c1f42d3
commit 09542e6b00
1 changed files with 2 additions and 1 deletions

View File

@ -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} );
}