#!C:\Python25\python.exe # -*- coding: UTF-8 -*- import os, sys, Cookie, hashlib import cgitb,cgi, time, random cgitb.enable() # ***** include the biocase.lib directory in the python sys path for importing ***** execfile( os.path.abspath( os.path.join( os.path.dirname( __file__ ), os.pardir, os.pardir, 'lib', 'biocase', 'adjustpath.py' ) )) execfile( os.path.abspath( os.path.join( os.path.dirname( __file__ ), os.pardir, os.pardir, 'lib', 'biocase', 'appinit.py' ) )) from biocase.configtool.general import * # check authentication! if dsa is None: execfile( os.path.abspath( os.path.join( os.path.dirname( __file__ ), 'main.cgi' ) )) sys.exit() # check authentication! authorize(form, dsa=dsa) # load html template tmpl = PageMacro('Content', PageMacro.DELMODE) tmpl.load('Content', os.path.join(templateDir, '_archive.html')) #sys.stdout.write('Content-Type: text\n\n') #for param in os.environ.keys(): # print "%20s %s" % (param,os.environ[param]) #cookieName = "org.biocase.bps2.%s"%(dsa) psfObj = dsaObj.getPSFObj(tmp=False) #_COOKIE = Cookie.SimpleCookie() #_COOKIE.load(os.environ['HTTP_COOKIE']) p = psfObj.adminpassword if p == None: random.seed(time.time()) p = str(random.random()) m = hashlib.md5() #m.update(str(_COOKIE[cookieName])+psfObj.adminpassword) m.update(dsa + p) tmpl['ticket'] = m.hexdigest() # # fill template # # general stuff tmpl['dsa'] = dsa tmpl['wrapper_url'] = dsaObj.getBioCASeAccessPoint() printOverHTTP( tmpl )