| GroupsDirectory | |
Exaple 3: Implementation example
import cgi
import MySQLdb
import gd
.
# Lets assume that the cgi contains:
# user=marvin&passwd=BoriNg&mod=news&group=pub&action=write
#
.
# The user authentication occures here to verify password.
.
qAction = '%s.%s.%s' % (cgi['group'], cgi['mod'], cgi['action'])
.
# We'll get the GD from a db query instead of a file this time.
rights = gd.load(sql.execute('select pickle from gd where name="rights"') \
.fetchone()[0])
.
.
.
if not rights.isIn(user, qAction):
print 'Content-type: text/html\n\nStep into my office.\n\nRegards\n\nZaphod')
.
.
.
| |
NotesThis is one example. There can be as many implementations as there are people in the world I guess. And this in not the only way of usage. GD can be useful to host a virtual filesystem for instace. |