Update of /cvsroot/tmda/tmda/contrib/cgi
In directory sc8-pr-cvs1:/tmp/cvs-serv24195

Modified Files:
        Session.py 
Log Message:
Bugfix:

Was swapping user name placeholder with home directory instead of login name.

Moved TMDARC rewriting to earlier in the authentication process to make sure 
variable is set when needed.


Index: Session.py
===================================================================
RCS file: /cvsroot/tmda/tmda/contrib/cgi/Session.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Session.py  28 Nov 2002 17:18:49 -0000      1.3
+++ Session.py  29 Nov 2002 17:16:12 -0000      1.4
@@ -84,12 +84,13 @@
         self.Vars = pickle.load(F)
         F.close()
         os.environ["HOME"] = self.Vars["HOME"]
+        os.environ["USER"] = self.Vars["User"]
         
         # Is there a TMDARC variable?
         if os.environ.has_key("TMDARC"):
           # Yes, replace it
           os.environ["TMDARC"] = string.replace(os.environ["TMDARC"], "/~/",
-            "/%s/" % self.Vars["HOME"])
+            "/%s/" % self.Vars["User"])
         
         # Now that we know who we are, get our defaults
         from TMDA import Defaults
@@ -108,6 +109,12 @@
 
     # Validate the new session?
     try:
+    # Is there a TMDARC variable?
+      if os.environ.has_key("TMDARC"):
+        # Yes, replace it
+        os.environ["TMDARC"] = string.replace(os.environ["TMDARC"], "/~/",
+          "/%s/" % Form["user"].value)
+  
       if Authenticate.CheckPassword(Form):
         self.Vars["User"]  = Form["user"].value
         PasswordRecord     = pwd.getpwnam(self.Vars["User"])
@@ -117,12 +124,6 @@
         os.environ["USER"] = self.Vars["User"]
         os.environ["HOME"] = self.Vars["HOME"]
         self.Vars["IP"]    = os.environ["REMOTE_ADDR"]
-  
-        # Is there a TMDARC variable?
-        if os.environ.has_key("TMDARC"):
-          # Yes, replace it
-          os.environ["TMDARC"] = string.replace(os.environ["TMDARC"], "/~/",
-            "/%s/" % self.Vars["User"])
   
         # Now that we know who we are, get our defaults
         from TMDA import Defaults

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs

Reply via email to