Mercurial > p > roundup > code
diff roundup/cgi/client.py @ 1004:5f12d3259f31
logout works better now
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sun, 01 Sep 2002 22:09:20 +0000 |
| parents | f89b8d32291b |
| children | efa19bdad6c3 |
line wrap: on
line diff
--- a/roundup/cgi/client.py Sun Sep 01 12:18:41 2002 +0000 +++ b/roundup/cgi/client.py Sun Sep 01 22:09:20 2002 +0000 @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.3 2002-09-01 12:18:40 richard Exp $ +# $Id: client.py,v 1.4 2002-09-01 22:09:20 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -60,6 +60,11 @@ Once a user logs in, they are assigned a session. The Client instance keeps the nodeid of the session as the "session" attribute. + + Client attributes: + "url" is the current url path + "path" is the PATH_INFO inside the instance + "base" is the base URL for the instance ''' def __init__(self, instance, request, env, form=None): @@ -67,16 +72,21 @@ self.instance = instance self.request = request self.env = env + self.path = env['PATH_INFO'] self.split_path = self.path.split('/') self.instance_path_name = env['INSTANCE_NAME'] + + # this is the base URL for this instance url = self.env['SCRIPT_NAME'] + '/' + self.instance_path_name - machine = self.env['SERVER_NAME'] - port = self.env['SERVER_PORT'] - if port != '80': machine = machine + ':' + port self.base = urlparse.urlunparse(('http', env['HTTP_HOST'], url, None, None, None)) + # request.path is the full request path + x, x, path, x, x, x = urlparse.urlparse(request.path) + self.url = urlparse.urlunparse(('http', env['HTTP_HOST'], path, + None, None, None)) + if form is None: self.form = cgi.FieldStorage(environ=env) else:
