mirror of https://github.com/dirtbags/moth.git
Remember team name and password if puzzler doesn't get correct key
This commit is contained in:
parent
c3fc949fa3
commit
db9a1be3ac
|
@ -111,7 +111,7 @@ def show_puzzles(cat, cat_dir):
|
||||||
print('<p>None (someone is slacking)</p>')
|
print('<p>None (someone is slacking)</p>')
|
||||||
end_html()
|
end_html()
|
||||||
|
|
||||||
def show_puzzle(cat, points, points_dir):
|
def show_puzzle(cat, points, points_dir, team, passwd):
|
||||||
# Show puzzle in cat for points
|
# Show puzzle in cat for points
|
||||||
start_html('%s for %s' % (cat, points))
|
start_html('%s for %s' % (cat, points))
|
||||||
fn = os.path.join(points_dir, 'index.html')
|
fn = os.path.join(points_dir, 'index.html')
|
||||||
|
@ -128,8 +128,8 @@ def show_puzzle(cat, points, points_dir):
|
||||||
print('<form action="puzzler.cgi" method="post">')
|
print('<form action="puzzler.cgi" method="post">')
|
||||||
print('<input type="hidden" name="c" value="%s" />' % cat)
|
print('<input type="hidden" name="c" value="%s" />' % cat)
|
||||||
print('<input type="hidden" name="p" value="%s" />' % points)
|
print('<input type="hidden" name="p" value="%s" />' % points)
|
||||||
print('Team: <input name="t" /><br />')
|
print('Team: <input name="t" value="%s" /><br />' % (team or ''))
|
||||||
print('Password: <input type="password" name="w" /><br />')
|
print('Password: <input type="password" name="w" value="%s" /><br />' % (passwd or ''))
|
||||||
print('Key: <input name="k" /><br />')
|
print('Key: <input name="k" /><br />')
|
||||||
print('<input type="submit" />')
|
print('<input type="submit" />')
|
||||||
print('</form>')
|
print('</form>')
|
||||||
|
@ -166,7 +166,7 @@ def main():
|
||||||
print()
|
print()
|
||||||
dump_file(fn)
|
dump_file(fn)
|
||||||
else:
|
else:
|
||||||
show_puzzle(cat, points, points_dir)
|
show_puzzle(cat, points, points_dir, team, passwd)
|
||||||
else:
|
else:
|
||||||
thekey = open('%s/key' % points_dir).read().strip()
|
thekey = open('%s/key' % points_dir).read().strip()
|
||||||
if not teams.chkpasswd(team, passwd):
|
if not teams.chkpasswd(team, passwd):
|
||||||
|
|
Loading…
Reference in New Issue