diff --git a/ctf.css b/ctf.css index b9aa22b..4131ef8 100644 --- a/ctf.css +++ b/ctf.css @@ -77,3 +77,7 @@ p { margin-bottom: 20px; color: #f4f4f4; } + +.solved { + text-decoration: line-through; +} \ No newline at end of file diff --git a/ctf/config.py b/ctf/config.py index 034eb71..56ab872 100755 --- a/ctf/config.py +++ b/ctf/config.py @@ -66,3 +66,23 @@ def datafile(filename): def url(path): return base_url + path + +def start_html(title): + if os.environ.get('GATEWAY_INTERFACE'): + print('Content-type: text/html') + print() + print(''' + + +
+') + print('') print(*vals) print('') @@ -59,32 +59,16 @@ passwd = f.getfirst('w', passwd) key = f.getfirst('k') def start_html(title): - if os.environ.get('GATEWAY_INTERFACE'): - print('Content-type: text/html') - if team or passwd: - c = http.cookies.SimpleCookie() - if team: - c['team'] = team - if passwd: - c['passwd'] = passwd - print(c) - print() - print(''' - - - -%s - - - -%s
-''' % (title, config.css, title)) - -def end_html(): - print('') + if team or passwd: + c = http.cookies.SimpleCookie() + if team: + c['team'] = team + if passwd: + c['passwd'] = passwd + print(c) + config.start_html(title) +end_html = config.end_html def safe_join(*args): safe = list(args[:1]) @@ -125,7 +109,17 @@ def show_puzzles(cat, cat_dir): if puzzles: print('
Pick a short team name: you'll be typing it a lot. @@ -58,7 +58,7 @@ def main(): ''' % config.url('register.cgi')) + - foot()) + config.end_html()) if not (team and pw and confirm_pw): # If we're starting from the beginning? html = html.substitute(team_error='', @@ -71,9 +71,9 @@ def main(): pw_match_error='Passwords do not match') else: teams.add(team, pw) - html = (head('Team registered') + + html = (config.start_html('Team registered') + ('
Congratulations, %s is now registered. Go back to the front page and start playing!
' % (team, config.url(''))) + - foot()) + config.end_html()) print(html)