changeset 2939:e8d22f8ff35a maint-0.7

determine user before context: SendFile exception handler requires initialized userid attribute. (thanks alex)
author Richard Jones <richard@users.sourceforge.net>
date Sun, 21 Nov 2004 21:52:34 +0000
parents 07166758e412
children 94c8d60c827a
files roundup/cgi/client.py
diffstat 1 files changed, 4 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/cgi/client.py	Wed Nov 17 22:10:02 2004 +0000
+++ b/roundup/cgi/client.py	Sun Nov 21 21:52:34 2004 +0000
@@ -1,4 +1,4 @@
-# $Id: client.py,v 1.176.2.7 2004-11-05 04:57:50 richard Exp $
+# $Id: client.py,v 1.176.2.8 2004-11-21 21:52:34 richard Exp $
 
 """WWW request handler (also used in the stand-alone server).
 """
@@ -187,15 +187,12 @@
         self.ok_message = []
         self.error_message = []
         try:
-            # figure out the context and desired content template
-            # do this first so we don't authenticate for static files
-            # Note: this method opens the database as "admin" in order to
-            # perform context checks
-            self.determine_context()
-
             # make sure we're identified (even anonymously)
             self.determine_user()
 
+            # figure out the context and desired content template
+            self.determine_context()
+
             # possibly handle a form submit action (may change self.classname
             # and self.template, and may also append error/ok_messages)
             html = self.handle_action()
@@ -401,9 +398,6 @@
                 # send the file identified by the designator in path[0]
                 raise SendFile, path[0]
 
-        # we need the db for further context stuff - open it as admin
-        self.opendb('admin')
-
         # see if we got a designator
         m = dre.match(self.classname)
         if m:
@@ -435,7 +429,6 @@
             raise NotFound, str(designator)
         classname, nodeid = m.group(1), m.group(2)
 
-        self.opendb('admin')
         klass = self.db.getclass(classname)
 
         # make sure we have the appropriate properties

Roundup Issue Tracker: http://roundup-tracker.org/