Commit 709254c0 authored by Jean Michel Rouly's avatar Jean Michel Rouly
Browse files

Added user registration function. Defaults to requiring mod approval.

parent 8fc67cc6
......@@ -86,6 +86,22 @@ def user_registered( username ):
return num_rows > 0
# Register a user --- that is, enter them in the registered database with a
# false (default=0) approval flag.
def register_user( user, name, desc ):
mdb,cursor = connect_to_mysql()
output = False
try:
sql = """INSERT INTO `%s`(`user`, `name`, `comment`) VALUES (%s, %s, %s)"""
cursor.execute( sql, (goconfig.sql_registration_table, user, name, desc) )
output = True
except MySQLdb.IntegrityError:
pass
mdb.commit()
mdb.close()
return output
# Log in a user by placing a cookie on their machine and entering
# the related hash in a SQL database.
def generate_cookie( 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