From: richard Date: Wed, 17 Oct 2001 00:18:41 +0000 (+0000) Subject: Manually constructing cookie headers now. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=711ef3707d86e46b24e68bc4e9524a9d5a5f9d3c;p=roundup.git Manually constructing cookie headers now. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@305 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py index 1fcc3fa..d35cfa5 100644 --- a/roundup/cgi_client.py +++ b/roundup/cgi_client.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: cgi_client.py,v 1.32 2001-10-16 03:36:21 richard Exp $ +# $Id: cgi_client.py,v 1.33 2001-10-17 00:18:41 richard Exp $ import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes import base64, Cookie, time @@ -513,10 +513,7 @@ class Client: user = base64.encodestring('%s:%s'%(self.user, password))[:-1] path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], '')) - cookie = Cookie.SmartCookie() - cookie['roundup_user'] = user - cookie['roundup_user']['path'] = path - self.header({'Set-Cookie': str(cookie)}) + self.header({'Set-Cookie': 'roundup_user=%s; Path=%s;'%(user, path)}) return self.index() def make_user_anonymous(self): @@ -532,12 +529,9 @@ class Client: # construct the logout cookie path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], '')) - cookie = Cookie.SmartCookie() - cookie['roundup_user'] = 'deleted' - cookie['roundup_user']['path'] = path - cookie['roundup_user']['expires'] = 0 - cookie['roundup_user']['max-age'] = 0 - self.header({'Set-Cookie': str(cookie)}) + now = Cookie._getdate() + self.header({'Set-Cookie': + 'roundup_user=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path)}) return self.index() def newuser_action(self, message=None): @@ -555,10 +549,7 @@ class Client: user = base64.encodestring('%s:%s'%(self.user, password))[:-1] path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], '')) - cookie = Cookie.SmartCookie() - cookie['roundup_user'] = user - cookie['roundup_user']['path'] = path - self.header({'Set-Cookie': str(cookie)}) + self.header({'Set-Cookie': 'roundup_user=%s; Path=%s;'%(user, path)}) return self.index() def main(self, dre=re.compile(r'([^\d]+)(\d+)'), @@ -780,6 +771,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0): # # $Log: not supported by cvs2svn $ +# Revision 1.32 2001/10/16 03:36:21 richard +# CGI interface wasn't handling checkboxes at all. +# # Revision 1.31 2001/10/14 10:55:00 richard # Handle empty strings in HTML template Link function #