11#!/usr/bin/env python
22
3- # $Id: roundup.cgi,v 1.1 2001-07-22 11:47:07 richard Exp $
3+ # $Id: roundup.cgi,v 1.2 2001-07-23 04:31:40 richard Exp $
44
55# python version check
66import sys
@@ -14,7 +14,7 @@ if int(sys.version[0]) < 2:
1414
1515# This indicates where the Roundup instance lives
1616ROUNDUPS = {
17- 'test ' : '/tmp/roundup_test ' ,
17+ 'roundup_test ' : '/tmp/' ,
1818}
1919
2020# Where to log debugging information to. Use an instance of DevNull if you
@@ -49,6 +49,7 @@ def main(instance, out):
4949 auth = os .environ .get ("HTTP_CGI_AUTHORIZATION" , None )
5050 message = 'Unauthorised'
5151 if auth :
52+ import binascii
5253 l = binascii .a2b_base64 (auth .split (' ' )[1 ]).split (':' )
5354 user = l [0 ]
5455 password = None
@@ -71,7 +72,7 @@ def main(instance, out):
7172 keys .sort ()
7273 out .write (message )
7374 return
74- client = instance .Client (out , os .environ , user )
75+ client = instance .Client (out , db , os .environ , user )
7576 try :
7677 client .main ()
7778 except cgi_client .Unauthorised :
@@ -86,7 +87,9 @@ out, err = sys.stdout, sys.stderr
8687try :
8788 sys .stdout = sys .stderr = LOG
8889 import os , string
89- instance = string .split (os .environ ['PATH_INFO' ], '/' )[1 ]
90+ path = string .split (os .environ ['PATH_INFO' ], '/' )
91+ instance = path [1 ]
92+ os .environ ['PATH_INFO' ] = string .join (path [2 :], '/' )
9093 if ROUNDUPS .has_key (instance ):
9194 instance_home = ROUNDUPS [instance ]
9295 sys .path .insert (0 , instance_home )
@@ -106,4 +109,7 @@ sys.stdout, sys.stderr = out, err
106109
107110#
108111# $Log: not supported by cvs2svn $
112+ # Revision 1.1 2001/07/22 11:47:07 richard
113+ # More Grande Splite
114+ #
109115#
0 commit comments