Merge pull request #42 from slinkymanbyday/view_keys_interface

view incorrect/correct key submission interfaces
This commit is contained in:
Kevin Chung
2015-09-13 20:43:38 -04:00
6 changed files with 182 additions and 5 deletions

View File

@@ -120,7 +120,7 @@ def init_challenges(app):
for x in keys:
if x.key_type == 0: #static key
if x.flag.strip().lower() == key:
solve = Solves(chalid=chalid, teamid=session['id'], ip=request.remote_addr)
solve = Solves(chalid=chalid, teamid=session['id'], ip=request.remote_addr, flag=key)
db.session.add(solve)
db.session.commit()
db.session.close()
@@ -129,7 +129,7 @@ def init_challenges(app):
elif x.key_type == 1: #regex
res = re.match(str(x), key, re.IGNORECASE)
if res and res.group() == key:
solve = Solves(chalid=chalid, teamid=session['id'], ip=request.remote_addr)
solve = Solves(chalid=chalid, teamid=session['id'], ip=request.remote_addr, flag=key)
db.session.add(solve)
db.session.commit()
db.session.close()