Commit d61aef14 authored by Jean Michel Rouly's avatar Jean Michel Rouly
Browse files

Introduced user registraiton requirement when logging in.

parent e21d9052
......@@ -53,7 +53,7 @@ def application(environ, start_response):
# unregister the user, in case they're already in
library.deactivate_user( hash_value )
# register the hashed user with the SQL database
library.activate_user( hash_value )
library.activate_user( hash_value, usr )
# push the cookie to the user and redirect
status = '303 See Other'
......@@ -79,10 +79,10 @@ def eat_cookie():
# Register the user in the table of active users.
def activate_user( hash_value ):
def activate_user( hash_value, user ):
mdb,cursor = connect_to_mysql()
sql = """INSERT INTO `%s` (`user_hash`) VALUES (%s);"""
cursor.execute( sql, (goconfig.sql_usr_table, hash_value) )
sql = """INSERT INTO `%s` (`user_hash`,`user`) VALUES (%s,%s);"""
cursor.execute( sql, (goconfig.sql_usr_table, hash_value, user) )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment