aboutsummaryrefslogtreecommitdiffstats
path: root/extensions/Mageia/lib/Util.pm
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/Mageia/lib/Util.pm')
-rw-r--r--extensions/Mageia/lib/Util.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/extensions/Mageia/lib/Util.pm b/extensions/Mageia/lib/Util.pm
index 11f4fcaf6..b70d39818 100644
--- a/extensions/Mageia/lib/Util.pm
+++ b/extensions/Mageia/lib/Util.pm
@@ -7,7 +7,7 @@
package Bugzilla::Extension::Mageia::Util;
-use 5.10.1;
+use 5.16.0; # required to use fc() for string comparison.
use strict;
use warnings;
@@ -97,7 +97,11 @@ sub sync_ldap_groups_check {
next unless $uid && $mail;
# Ignore the LDAP account if it does not exist in Bugzilla.
- my $bz_user = Bugzilla::User->new({ extern_id => $uid }) or next;
+ # extern_id may differ from UID as UID is always lowercase,
+ # so we also check the email address to validate the account.
+ my $bz_user = Bugzilla::User->new({ extern_id => $uid })
+ || Bugzilla::User->new({ name => $mail });
+ next unless $bz_user && fc($bz_user->extern_id) eq fc($uid);
$users{$user} = $bz_user;
}
$groups{$group}->{$users{$user}->extern_id} = $users{$user};