aboutsummaryrefslogtreecommitdiffstats
path: root/extensions/Mageia/lib
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@netscape.net>2017-10-10 00:26:15 +0200
committerFrédéric Buclin <LpSolit@netscape.net>2017-10-10 00:26:15 +0200
commit2c7b0be3f882ec09dc5b2fda71a90efe4761ac54 (patch)
tree506621cdff17d796d4caad4d1958728c23084bde /extensions/Mageia/lib
parentceefacd41df24ddb2c41e235a01938f479e40a22 (diff)
downloadbugs-2c7b0be3f882ec09dc5b2fda71a90efe4761ac54.tar
bugs-2c7b0be3f882ec09dc5b2fda71a90efe4761ac54.tar.gz
bugs-2c7b0be3f882ec09dc5b2fda71a90efe4761ac54.tar.bz2
bugs-2c7b0be3f882ec09dc5b2fda71a90efe4761ac54.tar.xz
bugs-2c7b0be3f882ec09dc5b2fda71a90efe4761ac54.zip
Bugzilla extern_id and LDAP uid may differ as uid is always lowercase
Diffstat (limited to 'extensions/Mageia/lib')
-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};