/[shmookey]/portconf/index.py


UCC Code Repository

Diff of /portconf/index.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 114 by shmookey, Wed May 28 10:30:17 2008 UTC revision 115 by shmookey, Thu May 29 08:33:56 2008 UTC
# Line 1  Line 1 
1  #!/usr/bin/python  #!/usr/bin/python
2    
3  import sys, re, pexpect  import sys, os, re, pexpect, time, Cookie
4  import Log, common  import Log, common
5    
6  try:  try:
# Line 26  form = cgi.FieldStorage () Line 26  form = cgi.FieldStorage ()
26    
27  # Cookie stuff  # Cookie stuff
28  cookieExpiry = time.gmtime(time.time())  cookieExpiry = time.gmtime(time.time())
29  if cookieExpiry[3] == 23: cookieExpiry[3] = 0  if cookieExpiry[3] == 23: cookieExpiry = cookieExpiry[:2] + (0,) + cookieExpiry[4:]
30  else: cookieExpiry[3] += 1  else: cookieExpiry = cookieExpiry[:2] + (cookieExpiry[3]+1,) + cookieExpiry[4:]
31  cookie = Cooke.Cookie (os.environ.get("HTTP_COOKIE", ""))  cookie = Cookie.SimpleCookie (os.environ.get("HTTP_COOKIE", ""))
32  if cookie.has_key ("sid"):  if cookie.has_key ("sid"):
33          session = cookie["sid"]          session = cookie["sid"]
34  else:  else:
35          # Not logged in, send them packing.          # Not logged in, fail.
36          print "Location: login.py"          print "Location: login.py"
37    
38    

Legend:
Removed from v.114  
changed lines
  Added in v.115

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26