|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -# $Id: cgi_client.py,v 1.128 2002-06-12 21:28:25 gmcm Exp $ |
| 18 | +# $Id: cgi_client.py,v 1.129 2002-06-20 23:52:11 richard Exp $ |
19 | 19 |
|
20 | 20 | __doc__ = """ |
21 | 21 | WWW request handler (also used in the stand-alone server). |
@@ -75,7 +75,16 @@ def __init__(self, instance, request, env, form=None): |
75 | 75 | self.indexer = RoundupIndexer('%s/db'%instance.INSTANCE_HOME) |
76 | 76 |
|
77 | 77 | def getuid(self): |
78 | | - return self.db.user.lookup(self.user) |
| 78 | + try: |
| 79 | + return self.db.user.lookup(self.user) |
| 80 | + except KeyError: |
| 81 | + if self.user is None: |
| 82 | + # user is not logged in and username 'anonymous' doesn't |
| 83 | + # exist in the database |
| 84 | + err = _('anonymous users have read-only access only') |
| 85 | + else: |
| 86 | + err = _("sanity check: unknown user name `%s'")%self.user |
| 87 | + raise Unauthorised, errmsg |
79 | 88 |
|
80 | 89 | def header(self, headers=None): |
81 | 90 | '''Put up the appropriate header. |
@@ -1366,6 +1375,10 @@ def parsePropsFromForm(db, cl, form, nodeid=0): |
1366 | 1375 |
|
1367 | 1376 | # |
1368 | 1377 | # $Log: not supported by cvs2svn $ |
| 1378 | +# Revision 1.128 2002/06/12 21:28:25 gmcm |
| 1379 | +# Allow form to set user-properties on a Fileclass. |
| 1380 | +# Don't assume that a Fileclass is named "files". |
| 1381 | +# |
1369 | 1382 | # Revision 1.127 2002/06/11 06:38:24 richard |
1370 | 1383 | # . #565996 ] The "Attach a File to this Issue" fails |
1371 | 1384 | # |
|
0 commit comments