1.1 --- a/WebStack/Resources/Login.py Sun Jan 21 00:32:06 2007 +0000
1.2 +++ b/WebStack/Resources/Login.py Tue Jan 23 19:38:45 2007 +0000
1.3 @@ -30,7 +30,7 @@
1.4
1.5 encoding = "utf-8"
1.6
1.7 - def __init__(self, authenticator, use_redirect=1, urlencoding=None):
1.8 + def __init__(self, authenticator, use_redirect=1, urlencoding=None, encoding=None):
1.9
1.10 """
1.11 Initialise the resource with an 'authenticator'.
1.12 @@ -42,6 +42,9 @@
1.13 The optional 'urlencoding' parameter allows a special encoding to be
1.14 used in producing the redirection path.
1.15
1.16 + The optional 'encoding' parameter allows a special encoding to be used
1.17 + in producing the login pages.
1.18 +
1.19 To change the pages employed by this resource, either redefine the
1.20 'login_page' and 'success_page' attributes in instances of this class or
1.21 a subclass, or override the 'show_login' and 'show_success' methods.
1.22 @@ -49,7 +52,8 @@
1.23
1.24 self.authenticator = authenticator
1.25 self.use_redirect = use_redirect
1.26 - self.urlencoding = urlencoding or self.encoding
1.27 + self.urlencoding = urlencoding
1.28 + self.encoding = encoding or self.encoding
1.29
1.30 def respond(self, trans):
1.31
1.32 @@ -192,10 +196,10 @@
1.33
1.34 # General functions.
1.35
1.36 -def get_target(trans, urlencoding, encoding):
1.37 +def get_target(trans, urlencoding=None, encoding=None):
1.38
1.39 """
1.40 - Return the application, path and query string for 'trans' using the given
1.41 + Return the application, path and query string for 'trans' using the optional
1.42 'urlencoding' (or path encoding) and request body 'encoding'.
1.43 """
1.44