CVS: tmda-cgi Install.py, 1.29, 1.30 Release.py, 1.11, 1.12 Session.py, 1.39, 1.40 configure, 1.20, 1.21

Jim Ramsay <[email protected]> Thu, 11 Mar 2004 07:21:42 -0800
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda-cgi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17902

Modified Files:
	Install.py Release.py Session.py configure 
Log Message:
Check / Set $USER and $LOGNAME


Index: Install.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/Install.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- Install.py	27 Jan 2004 16:55:24 -0000	1.29
+++ Install.py	11 Mar 2004 15:21:38 -0000	1.30
@@ -639,6 +639,10 @@
   from TMDA import Util
 
   # Make a substitution dictionary
+  if os.environ.has_key( "USER" ):
+    user = os.environ["USER"]
+  elif os.environ.has_key( "LOGNAME" )  
+    user = os.environ["LOGNAME"]
   global Dict
   Dict = \
   {
@@ -650,7 +654,7 @@
     "Parent":    "..",
     "RealHome":  pwd.getpwuid(os.geteuid())[5],
     "UrlDomain": os.environ["SERVER_NAME"],
-    "User":      os.environ["USER"],
+    "User":      user,
     "VPop":      PVars[("NoOverride", "VPop")],
     "VPopBin":   PVars[("NoOverride", "VPopBin")]
   }

Index: Release.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/Release.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Release.py	14 Jul 2003 21:15:20 -0000	1.11
+++ Release.py	11 Mar 2004 15:21:38 -0000	1.12
@@ -133,6 +133,7 @@
 
   # We now have the home directory and the User.  Set this in the environment.
   os.environ["USER"] = User
+  os.environ["LOGNAME"] = User
   os.environ["HOME"] = Home
 
   # Is there a TMDARC variable?

Index: Session.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/Session.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- Session.py	17 Nov 2003 02:34:43 -0000	1.39
+++ Session.py	11 Mar 2004 15:21:39 -0000	1.40
@@ -221,8 +221,10 @@
     Match = re.search(self[("NoOverride", "UserSplit")], self.Vars["User"])
     if Match:
       os.environ["USER"] = Match.group(1)
+      os.environ["LOGNAME"] = Match.group(1)
     else:
       os.environ["USER"] = self.Vars["User"]
+      os.environ["LOGNAME"] = self.Vars["User"]
 
     # Clean up
     self.CleanUp()

Index: configure
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/configure,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- configure	10 Dec 2003 19:35:08 -0000	1.20
+++ configure	11 Mar 2004 15:21:39 -0000	1.21
@@ -446,8 +446,14 @@
   F.write('#define VLOOKUP  "TMDA_VLOOKUP=%(VLookup)s"\n' % OptD)
 if OptD["Config"] != "None":
   if OptD["Config"].find("~") >= 0:
+    if os.environ.has_key( "USER" ):
+      user = os.environ["USER"]
+    elif os.environ.has_key( "LOGNAME" ):  
+      user = os.environ["LOGNAME"]
+    else:
+      user = os.getlogin()
     OptD["Config"] = \
-      string.replace(OptD["Config"], "/%s/" % os.environ["USER"], "/~/")
+      string.replace(OptD["Config"], "/%s/" % user, "/~/")
     print """NOTE:
 tmda-cgi will look for config files at: %s
 Where <user> will be replaced by the user's login name.