~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to makeuser.py

  • Committer: dcoles
  • Date: 2008-08-18 04:34:11 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1021
Database: Adds active column to problem_attempt table.
This allows a group of problem attempts (ie. from previous semesters) to be
marked as 'inactive' and thus counting toward a problem being assessment for
the current semester.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
import sys
31
31
import os
32
 
import os.path
33
 
import pwd
34
32
import getopt
35
 
import random
36
 
# Import modules from the website is tricky since they're in the www
37
 
# directory.
38
 
sys.path.append(os.path.join(os.getcwd(), 'www'))
39
 
import conf
40
 
import common.makeuser, common.db
 
33
import common.makeuser
41
34
 
42
35
# Requireds and optionals will be used to display the usage message
43
36
# AND do argument processing
45
38
requireds = ["login", "fullname", "rolenm"]
46
39
optionals = [
47
40
    ('p', 'password', "Cleartext password for this user"),
48
 
    ('u', 'unixid', "Numeric unix user id"),
49
41
    ('n', 'nick', "Display name (defaults to <fullname>)"),
50
42
    ('e', 'email', "Email address"),
51
43
    ('s', 'studentid', "Student ID")
85
77
if 'nick' not in user:
86
78
    user['nick'] = user['fullname']
87
79
 
88
 
# Resolve the user's username into a UID
89
 
if 'unixid' not in user:
90
 
    try:
91
 
        (_,_,uid,_,_,_,_) = pwd.getpwnam(login)
92
 
        user['unixid'] = uid
93
 
    except KeyError:
94
 
        pass
95
 
 
96
80
try:
97
81
    # Make the user's database entry
98
82
    common.makeuser.make_user_db(**user)