From baed5713d175eee3fe2aed9ee3afef916b4641d4 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Thu, 6 Aug 2015 16:48:13 +0200 Subject: Bug 1179160: The login form should not use type="email" when LDAP has LDAPmailattribute set r=gerv a=dkl --- Bugzilla/Template.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Bugzilla') diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 6665029f4..ef45cb313 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -1151,6 +1151,17 @@ sub create { return \@optional; }, 'default_authorizer' => sub { return Bugzilla::Auth->new() }, + + 'login_not_email' => sub { + my $params = Bugzilla->params; + my $cache = Bugzilla->request_cache; + + return $cache->{login_not_email} //= + ($params->{emailsuffix} + || ($params->{user_verify_class} =~ /LDAP/ && $params->{LDAPmailattribute}) + || ($params->{user_verify_class} =~ /RADIUS/ && $params->{RADIUS_email_suffix})) + ? 1 : 0; + }, }, }; # Use a per-process provider to cache compiled templates in memory across -- cgit v1.2.3-24-g4f1b