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

« back to all changes in this revision

Viewing changes to makeuser.py

  • Committer: wagrant
  • Date: 2008-07-25 01:11:00 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:953
Add users/ to the front of all Subversion repositories, to clear the
namespace for group support. This *will* break existing setups.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
import sys
31
31
import os
32
32
import os.path
33
 
import pwd
34
33
import getopt
35
34
import random
36
35
# Import modules from the website is tricky since they're in the www
45
44
requireds = ["login", "fullname", "rolenm"]
46
45
optionals = [
47
46
    ('p', 'password', "Cleartext password for this user"),
48
 
    ('u', 'unixid', "Numeric unix user id"),
49
47
    ('n', 'nick', "Display name (defaults to <fullname>)"),
50
48
    ('e', 'email', "Email address"),
51
49
    ('s', 'studentid', "Student ID")
85
83
if 'nick' not in user:
86
84
    user['nick'] = user['fullname']
87
85
 
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
 
        user['unixid'] = random.randrange(5000,10000)
95
 
 
96
86
try:
97
87
    # Make the user's database entry
98
88
    common.makeuser.make_user_db(**user)