From a2ae154592af0131e13f935802839679e4e88924 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Thu, 6 Aug 2015 16:52:59 +0200 Subject: [PATCH] Bug 1179160: The login form should not use type="email" when LDAP has LDAPmailattribute set r=gerv a=dkl --- Bugzilla/Template.pm | 11 +++++++++++ .../en/default/account/auth/login-small.html.tmpl | 4 ++-- template/en/default/account/auth/login.html.tmpl | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 6ac36f783f..80f091f8c8 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -1158,6 +1158,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 diff --git a/template/en/default/account/auth/login-small.html.tmpl b/template/en/default/account/auth/login-small.html.tmpl index 790c135bfa..65aa861a12 100644 --- a/template/en/default/account/auth/login-small.html.tmpl +++ b/template/en/default/account/auth/login-small.html.tmpl @@ -34,7 +34,7 @@ id="mini_login[% qs_suffix FILTER html %]">