forked from github/server
form test
This commit is contained in:
parent
bdeeee61bb
commit
cadccb9804
1 changed files with 19 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
|
@ -21,6 +21,9 @@ def Display(Content, Title=DefaultTitle):
|
||||||
TemplateInput = TemplateHandle.read()
|
TemplateInput = TemplateHandle.read()
|
||||||
TemplateHandle.close() # close the file
|
TemplateHandle.close() # close the file
|
||||||
|
|
||||||
|
for field in Form.keys():
|
||||||
|
Content=Content+"<br>"+key+"="+Form[key]
|
||||||
|
|
||||||
# this defines an exception string in case our
|
# this defines an exception string in case our
|
||||||
# template file is messed up
|
# template file is messed up
|
||||||
BadTemplateException = "There was a problem with the HTML template."
|
BadTemplateException = "There was a problem with the HTML template."
|
||||||
|
@ -66,10 +69,10 @@ def ShowInfo(custid, Password):
|
||||||
|
|
||||||
output=output+"</table></div>"
|
output=output+"</table></div>"
|
||||||
|
|
||||||
query = ("select games.name, races.name, subscriptions.status, subscriptions.faction "+
|
query = ("select games.name, races.name, s.status, s.faction "+
|
||||||
"from races, games, subscriptions "+
|
"from races, games, subscriptions s "+
|
||||||
"where subscriptions.race=races.race and subscriptions.game=games.id "+
|
"where s.race=races.race and s.game=games.id "+
|
||||||
"and subscriptions.user="+str(custid)+" ");
|
"and s.user="+str(custid)+" ");
|
||||||
|
|
||||||
results = cursor.execute(query);
|
results = cursor.execute(query);
|
||||||
|
|
||||||
|
@ -104,7 +107,7 @@ def ShowInfo(custid, Password):
|
||||||
output=output+line
|
output=output+line
|
||||||
|
|
||||||
output=output+"</table></div>"
|
output=output+"</table></div>"
|
||||||
# output=output+"<div align=left><input type=submit value=\"Speichern\"></div>"
|
output=output+"<div align=left><input type=submit value=\"Speichern\"></div>"
|
||||||
output=output+"</form>"
|
output=output+"</form>"
|
||||||
else:
|
else:
|
||||||
output = "Die Kundennummer oder das angegebene Passwort sind nicht korrekt."
|
output = "Die Kundennummer oder das angegebene Passwort sind nicht korrekt."
|
||||||
|
@ -130,10 +133,14 @@ def SendPass(custid):
|
||||||
|
|
||||||
Form = cgi.FieldStorage()
|
Form = cgi.FieldStorage()
|
||||||
|
|
||||||
|
if Form.has_key("user"):
|
||||||
|
custid = int(Form["user"].value)
|
||||||
|
|
||||||
if Form.has_key("user"):
|
if Form.has_key("user"):
|
||||||
custid = int(Form["user"].value)
|
custid = int(Form["user"].value)
|
||||||
else:
|
else:
|
||||||
custid = 0
|
custid = 0
|
||||||
|
|
||||||
if Form.has_key("pass"):
|
if Form.has_key("pass"):
|
||||||
Password = Form["pass"].value
|
Password = Form["pass"].value
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue