28 lines
605 B
Python
Executable File
28 lines
605 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import random
|
|
|
|
from helpers import get_client_cert
|
|
from db import *
|
|
|
|
TLS_CLIENT_HASH = get_client_cert()
|
|
user_id = check_hash(TLS_CLIENT_HASH)
|
|
user_name = get_name(user_id) or "[Not Set]"
|
|
game_id = get_game_id(user_id)
|
|
|
|
print("# List")
|
|
|
|
print("=> game.cgi back to game")
|
|
|
|
print("## Game",game_id)
|
|
|
|
conn=create_connection()
|
|
with conn:
|
|
cur = conn.cursor()
|
|
cur.execute("SELECT name,words FROM users,plays WHERE plays.user_id=id and plays.game_id=?",(game_id,))
|
|
rows = cur.fetchall()
|
|
for row in rows:
|
|
print("## "+row[0])
|
|
print(' '.join(row[1].split(",")))
|
|
print()
|