Commit 90f6ee45 authored by Jean Michel Rouly's avatar Jean Michel Rouly
Browse files

Introduced registered user table.

parent 595c7c28
......@@ -37,6 +37,9 @@ sql_url_table = "urls"
# sql_usr_table: The SQL table storing the active users.
sql_usr_table = "usrs"
# sql_registration_table: The SQL table storing registered users.
sql_registration_table = "registered"
#ldap_domain: The location of the LDAP database to connect to.
ldap_domain = "ldaps://directory.gmu.edu:636"
......
......@@ -36,6 +36,12 @@ def user_logged_in( environ ):
return False
# Determine if the user has posting permissions via the registration
# datbase.
def user_registered( username ):
pass
# Log in a user by placing a cookie on their machine and entering
# the related hash in a SQL database.
def generate_cookie( user ):
......@@ -104,10 +110,16 @@ def connect_to_mysql():
sql = """CREATE TABLE IF NOT EXISTS `%s`(
id INT NOT NULL AUTO_INCREMENT,
user_name VARCHAR(500),
PRIMARY KEY(id),
user_hash VARCHAR(500));"""
cursor.execute( sql, (goconfig.sql_usr_table) )
sql = """CREATE TABLE IF NOT EXISTS `%s`(
user VARCHAR(500),
PRIMARY KEY(user));"""
cursor.execute( sql, (goconfig.sql_registration_table) )
return mdb, cursor
......
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