1.1 --- a/WebStack/ModPython.py Thu May 27 22:18:00 2004 +0000
1.2 +++ b/WebStack/ModPython.py Sat May 29 17:25:44 2004 +0000
1.3 @@ -25,6 +25,7 @@
1.4
1.5 self.trans = trans
1.6 self.response_code = apache.OK
1.7 + self.user = None
1.8
1.9 # Request-related methods.
1.10
1.11 @@ -167,7 +168,10 @@
1.12 Returns a username as a string or None if no user is defined.
1.13 """
1.14
1.15 - return self.trans.user
1.16 + if self.user is not None:
1.17 + return self.user
1.18 + else:
1.19 + return self.trans.user
1.20
1.21 def get_cookies(self):
1.22
1.23 @@ -300,4 +304,16 @@
1.24 # NOTE: Should raise an exception or provide an implementation.
1.25 pass
1.26
1.27 + # Application-specific methods.
1.28 +
1.29 + def set_user(self, username):
1.30 +
1.31 + """
1.32 + An application-specific method which sets the user information with
1.33 + 'username' in the transaction. This affects subsequent calls to
1.34 + 'get_user'.
1.35 + """
1.36 +
1.37 + self.user = username
1.38 +
1.39 # vim: tabstop=4 expandtab shiftwidth=4