Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 1096:fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 10 Sep 2002 03:01:20 +0000 |
| parents | 04a6b3bfbf23 |
| children | db787cef1385 |
comparison
equal
deleted
inserted
replaced
| 1095:711f2ecee20f | 1096:fa7df238e2d4 |
|---|---|
| 1 # $Id: client.py,v 1.25 2002-09-09 23:55:19 richard Exp $ | 1 # $Id: client.py,v 1.26 2002-09-10 03:01:18 richard Exp $ |
| 2 | 2 |
| 3 __doc__ = """ | 3 __doc__ = """ |
| 4 WWW request handler (also used in the stand-alone server). | 4 WWW request handler (also used in the stand-alone server). |
| 5 """ | 5 """ |
| 6 | 6 |
| 74 self.request = request | 74 self.request = request |
| 75 self.env = env | 75 self.env = env |
| 76 | 76 |
| 77 self.path = env['PATH_INFO'] | 77 self.path = env['PATH_INFO'] |
| 78 self.split_path = self.path.split('/') | 78 self.split_path = self.path.split('/') |
| 79 self.instance_path_name = env['INSTANCE_NAME'] | 79 self.instance_path_name = env['TRACKER_NAME'] |
| 80 | 80 |
| 81 # this is the base URL for this instance | 81 # this is the base URL for this instance |
| 82 url = self.env['SCRIPT_NAME'] + '/' + self.instance_path_name | 82 url = self.env['SCRIPT_NAME'] + '/' + self.instance_path_name |
| 83 self.base = urlparse.urlunparse(('http', env['HTTP_HOST'], url, | 83 self.base = urlparse.urlunparse(('http', env['HTTP_HOST'], url, |
| 84 None, None, None)) | 84 None, None, None)) |
| 429 | 429 |
| 430 # expire us in a long, long time | 430 # expire us in a long, long time |
| 431 expire = Cookie._getdate(86400*365) | 431 expire = Cookie._getdate(86400*365) |
| 432 | 432 |
| 433 # generate the cookie path - make sure it has a trailing '/' | 433 # generate the cookie path - make sure it has a trailing '/' |
| 434 path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], | 434 path = '/'.join((self.env['SCRIPT_NAME'], self.env['TRACKER_NAME'], |
| 435 '')) | 435 '')) |
| 436 self.header({'Set-Cookie': 'roundup_user_2=%s; expires=%s; Path=%s;'%( | 436 self.header({'Set-Cookie': 'roundup_user_2=%s; expires=%s; Path=%s;'%( |
| 437 self.session, expire, path)}) | 437 self.session, expire, path)}) |
| 438 | 438 |
| 439 def make_user_anonymous(self): | 439 def make_user_anonymous(self): |
| 450 ''' | 450 ''' |
| 451 self.make_user_anonymous() | 451 self.make_user_anonymous() |
| 452 | 452 |
| 453 # construct the logout cookie | 453 # construct the logout cookie |
| 454 now = Cookie._getdate() | 454 now = Cookie._getdate() |
| 455 path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], | 455 path = '/'.join((self.env['SCRIPT_NAME'], self.env['TRACKER_NAME'], |
| 456 '')) | 456 '')) |
| 457 self.header({'Set-Cookie': | 457 self.header({'Set-Cookie': |
| 458 'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, | 458 'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, |
| 459 path)}) | 459 path)}) |
| 460 self.login() | 460 self.login() |
| 526 # log us out | 526 # log us out |
| 527 self.make_user_anonymous() | 527 self.make_user_anonymous() |
| 528 | 528 |
| 529 # construct the logout cookie | 529 # construct the logout cookie |
| 530 now = Cookie._getdate() | 530 now = Cookie._getdate() |
| 531 path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], | 531 path = '/'.join((self.env['SCRIPT_NAME'], self.env['TRACKER_NAME'], |
| 532 '')) | 532 '')) |
| 533 self.header(headers={'Set-Cookie': | 533 self.header(headers={'Set-Cookie': |
| 534 'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path)}) | 534 'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path)}) |
| 535 | 535 |
| 536 # Let the user know what's going on | 536 # Let the user know what's going on |
