Code

Manually constructing cookie headers now.
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Wed, 17 Oct 2001 00:18:41 +0000 (00:18 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Wed, 17 Oct 2001 00:18:41 +0000 (00:18 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@305 57a73879-2fb5-44c3-a270-3262357dd7e2

roundup/cgi_client.py

index 1fcc3fad9efbe9b16641786868c051b6617e15b4..d35cfa552f15ec0aec4a3d204743856bdd8f33ce 100644 (file)
@@ -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
 #