Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
90f6ee45
Commit
90f6ee45
authored
Oct 14, 2013
by
Jean Michel Rouly
Browse files
Introduced registered user table.
parent
595c7c28
Changes
2
Hide whitespace changes
Inline
Side-by-side
wsgi/goconfig.py.template
View file @
90f6ee45
...
...
@@ -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"
...
...
wsgi/library.py
View file @
90f6ee45
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment