From d9cbb0f0a62bba345ed26ac68364bb441f41d35d Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Fri, 12 May 2006 09:40:56 +0000 Subject: Bug 300410: Bugzilla::Auth needs to be restructured to not require a BEGIN block Patch By Max Kanat-Alexander r=LpSolit, a=myk --- template/en/default/global/code-error.html.tmpl | 52 ++++++++++++++++++++--- template/en/default/global/useful-links.html.tmpl | 9 ++-- template/en/default/global/user-error.html.tmpl | 4 -- 3 files changed, 51 insertions(+), 14 deletions(-) (limited to 'template/en/default/global') diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl index d9220f27b..1c15255af 100644 --- a/template/en/default/global/code-error.html.tmpl +++ b/template/en/default/global/code-error.html.tmpl @@ -48,15 +48,23 @@ Attachment #[% attach_id FILTER html %] ([% description FILTER html %]) is already obsolete. - [% ELSIF error == "auth_err" %] - [% title = "Internal Authentication Error" %] - [%# Authentication errors are in a template depending on the auth method, - for pluggability. - #%] - [% INCLUDE "account/auth/$authmethod-error.html.tmpl" %] + [% ELSIF error == "auth_invalid_email" %] + [% title = "Invalid Email Address" %] + We received an email address ([% addr FILTER html %]) + that didn't pass our syntax checking for a legal email address, + when trying to create or update your account. + [% IF default %] + A legal address must contain exactly one '@', + and at least one '.' after the @. + [% ELSE %] + [%+ Param('emailregexpdesc') %] + [% END %] + It must also not contain any of these special characters: + \ ( ) & < > , ; : " [ ], or any whitespace. [% ELSIF error == "authres_unhandled" %] - An authorization handler return value was not handled by the login code. + The result value of [% value FILTER html %] was not handled by + the login code. [% ELSIF error == "bad_page_cgi_id" %] [% title = "Invalid Page ID" %] @@ -103,10 +111,27 @@ [% ELSIF error == "cookies_need_value" %] Every cookie must have a value. + [% ELSIF error == "env_no_email" %] + [% terms.Bugzilla %] did not receive an email address from the + environment. + [% IF Param("auth_env_email") %] + This means that the '[% Param("auth_env_email") FILTER html %]' + environment variable was empty or did not exist. + [% ELSE %] + You need to set the "auth_env_email" environment variable to + the name of the environment variable that will contain the + user's email address. + [% END %] + [% ELSIF error == "extension_invalid" %] An error occured processing hook [% name FILTER html %] in extension [% extension FILTER html %]. + [% ELSIF error == "extern_id_conflict" %] + The external ID '[% extern_id FILTER html %]' already exists + in the database for '[% username FILTER html %]', but your + account source says that '[% extern_user FILTER html %]' has that ID. + [% ELSIF error == "field_type_mismatch" %] Cannot seem to handle [% field FILTER html %] and [% type FILTER html %] together. @@ -247,6 +272,19 @@ given. [% END %] + [% ELSIF error == "ldap_bind_failed" %] + Failed to bind to the LDAP server. The error message was: + [% errstr FILTER html %] + + [% ELSIF error == "ldap_cannot_retreive_attr" %] + The specified LDAP attribute [% attr FILTER html %] was not found. + + [% ELSIF error == "ldap_connect_failed" %] + Could not connect to the LDAP server [% server FILTER html %]. + + [% ELSIF error == "ldap_server_not_defined" %] + The LDAP server for authentication has not been defined. + [% ELSIF error == "missing_bug_id" %] No [% terms.bug %] ID was given. diff --git a/template/en/default/global/useful-links.html.tmpl b/template/en/default/global/useful-links.html.tmpl index b2e598163..3ac44d62a 100644 --- a/template/en/default/global/useful-links.html.tmpl +++ b/template/en/default/global/useful-links.html.tmpl @@ -57,7 +57,7 @@ [% IF user.login %] [% ' | Sanity check' IF user.groups.tweakparams %] - [% IF user.get_flag('can_logout') %] + [% IF user.authorizer.can_logout %] | Log out  [% ELSE %] | Logged in as  @@ -70,10 +70,13 @@ [% user.login FILTER html %] [% END %] [% ELSE %] - [% IF Param('createemailregexp') %] + [% IF Param('createemailregexp') + && user.authorizer.user_can_create_account %] | New Account [% END %] - | Log In + [% IF user.authorizer.can_login %] + | Log In + [% END %] [% END %] diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index e12bdf032..ee7f6c17d 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -1339,10 +1339,6 @@ [% title = "Wrong Token" %] That token cannot be used to change your password. - [% ELSIF error == "extern_id_conflict" %] - [% title = "Extern ID Conflict" %] - Someone with a different external ID has that address. - [% ELSIF error == "wrong_token_for_confirming_email_change" %] [% title = "Wrong Token" %] That token cannot be used to change your email address. -- cgit v1.2.3-24-g4f1b