1.1 --- a/examples/Common/Login/__init__.py Sun May 30 15:34:05 2004 +0000
1.2 +++ b/examples/Common/Login/__init__.py Sun May 30 15:58:18 2004 +0000
1.3 @@ -9,23 +9,16 @@
1.4
1.5 "A resource providing a login screen."
1.6
1.7 - def __init__(self, authenticator, anonymous_parameter_name=None, anonymous_username="anonymous", use_redirect=1):
1.8 + def __init__(self, authenticator, use_redirect=1):
1.9
1.10 """
1.11 Initialise the resource with an 'authenticator'.
1.12
1.13 - If the optional 'anonymous_parameter_name' is set, clients providing a parameter
1.14 - of that name in the URL will not be authenticated, but then such clients will not
1.15 - get a user identity associated with them. The optional 'anonymous_username' is the
1.16 - username appearing as the identity of anonymous users.
1.17 -
1.18 If the optional 'use_redirect' flag is set to 0, a confirmation screen is given
1.19 instead of redirecting the user back to the original application.
1.20 """
1.21
1.22 self.authenticator = authenticator
1.23 - self.anonymous_parameter_name = anonymous_parameter_name
1.24 - self.anonymous_username = anonymous_username
1.25 self.use_redirect = use_redirect
1.26
1.27 def respond(self, trans):
1.28 @@ -44,19 +37,9 @@
1.29 else:
1.30 redirect = ""
1.31
1.32 - # Check for the anonymous parameter, if appropriate.
1.33 -
1.34 - if self.anonymous_parameter_name is not None and fields_path.has_key(self.anonymous_parameter_name):
1.35 -
1.36 - # Make a special cookie token.
1.37 + # Check for a submitted login form.
1.38
1.39 - self.authenticator.set_token(trans, self.anonymous_username)
1.40 - self._redirect(trans, redirect)
1.41 - return
1.42 -
1.43 - # Otherwise, check for a submitted login form.
1.44 -
1.45 - elif fields_body.has_key("login"):
1.46 + if fields_body.has_key("login"):
1.47 if self.authenticator.authenticate(trans):
1.48 self._redirect(trans, redirect)
1.49