From: Frédéric Buclin Date: Thu, 6 Aug 2015 14:48:13 +0000 (+0200) Subject: Bug 1179160: The login form should not use type="email" when LDAP has LDAPmailattribu... X-Git-Tag: release-5.1.1~207 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=baed5713d175eee3fe2aed9ee3afef916b4641d4;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 6665029f49..ef45cb313d 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 diff --git a/template/en/default/account/auth/login-small.html.tmpl b/template/en/default/account/auth/login-small.html.tmpl index 5081512417..1b7c6b02e3 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 %]">