Esempio n. 1
0
File: list.py Progetto: akrherz/pals
def Main():
	
	form = cgi.FormContent()
	if form.has_key("className"):
		className = form["className"][0]
		origPass = advdb.query("SELECT classpasswd from classes WHERE class_abv = '"+className+"' ").dictresult()[0]["classpasswd"]

		if form.has_key("classpasswd"):
			classpasswd = form["classpasswd"][0]					
			if classpasswd != origPass:
				style.SendError("The password you entered was incorrect, Try again.")
			makePage(className)
		elif origPass == "No" or form.has_key("sstr"):
			makePage(className)			

		elif origPass != "No":
			SEVERE2.setupPage("Class Authentification.")
			print '<H3>Password Required:</H3>'
			print '<P>This class requires a password, please enter it now.'
			print '<form method="POST" action="list.py">'
			print '<input type="hidden" name="className" value="'+className+'">'	
			print '<BR><B>Enter Password:</B> <input type="text" name="classpasswd">'
			print '<BR><input type="SUBMIT" value="Enter Exercise">'
			print '</form>'
			SEVERE2.finishPage("advanced")
			sys.exit(0)

		else:
			style.jump_page("first.py?className="+className+"&caseNum="+caseNum+"")

	else:
		SEVERE2.setupPage("Sx Wx Forecasting Activity | Advanced Version")
		askForClass()
		SEVERE2.finishPage("advanced")
		sys.exit(0)	
Esempio n. 2
0
File: del.py Progetto: akrherz/pals
def Main():
	form = cgi.FormContent()
	zticks = str(form["zticks"][0])
	caseNum = str(form["caseNum"][0])

	nowDate = DateTime.gmtime(zticks)

        strTicks = DateTime.ISO.strGMT(nowDate)

	delete = mydb.query("DELETE from specquestions WHERE validTime = '"+strTicks+"' ")

	style.jump_page('index.py?caseNum='+caseNum)