changed trigger for button appearance in footer from blacklist to whitelist: buttons now have to be requested explicitly.
This commit is contained in:
parent
bcab27acf1
commit
a921e193de
3 changed files with 4 additions and 4 deletions
|
@ -31,7 +31,7 @@ def debug(req,form, optstr = ""):
|
||||||
else:
|
else:
|
||||||
req.write("Debug: "+optstr+"<br>\n")
|
req.write("Debug: "+optstr+"<br>\n")
|
||||||
|
|
||||||
def footer(req,form):
|
def footer(req,form,display_buttons=0):
|
||||||
"""return html footer"""
|
"""return html footer"""
|
||||||
try:
|
try:
|
||||||
username=form["username"]
|
username=form["username"]
|
||||||
|
@ -39,7 +39,7 @@ def footer(req,form):
|
||||||
except: #not logged in
|
except: #not logged in
|
||||||
username = ""
|
username = ""
|
||||||
sessionid = ""
|
sessionid = ""
|
||||||
if ((username != "") and (sessionid != "")) and ("logout" not in form.keys()):
|
if display_buttons:
|
||||||
data = """
|
data = """
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<input type="hidden" name="sessionid" value="%s">
|
<input type="hidden" name="sessionid" value="%s">
|
||||||
|
|
2
login.py
2
login.py
|
@ -97,7 +97,7 @@ def game_overview_form(req,form):
|
||||||
""" % (sessionid, username)
|
""" % (sessionid, username)
|
||||||
else:
|
else:
|
||||||
data+= "Sorry, all your game slots are in use."
|
data+= "Sorry, all your game slots are in use."
|
||||||
data+=helper.footer(req,form)
|
data+=helper.footer(req,form,1)
|
||||||
req.write(data)
|
req.write(data)
|
||||||
|
|
||||||
def login_form(req,form):
|
def login_form(req,form):
|
||||||
|
|
|
@ -81,7 +81,7 @@ def main(req,form):
|
||||||
#print goban
|
#print goban
|
||||||
data += goban.display_goban(gobandict,req,form)
|
data += goban.display_goban(gobandict,req,form)
|
||||||
data += login.navigation_bar(req,form)
|
data += login.navigation_bar(req,form)
|
||||||
data += helper.footer(req,form)
|
data += helper.footer(req,form,1)
|
||||||
req.write(data)
|
req.write(data)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue