From: Frédéric Buclin Date: Thu, 6 Aug 2015 14:52:59 +0000 (+0200) Subject: Bug 1179160: The login form should not use type="email" when LDAP has LDAPmailattribu... X-Git-Tag: release-5.0.1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2ae154592af0131e13f935802839679e4e88924;p=thirdparty%2Fbugzilla.git Bug 1179160: The login form should not use type="email" when LDAP has LDAPmailattribute set r=gerv a=dkl --- 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 %]">