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

« back to all changes in this revision

Viewing changes to scripts/usrmgt-server

  • Committer: mattgiuca
  • Date: 2008-02-14 06:29:59 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:464
usermgt-server: Added email.
Also allowed optional args to be omitted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
                      absent or None, this is an indication that external
40
40
                      authentication should be used (i.e. LDAP).
41
41
                      STRING OPTIONAL
 
42
        email       - the user's email address.
 
43
                      STRING OPTIONAL
42
44
        nick        - the display name to use.
43
45
                      STRING REQUIRED
44
46
        fullname    - The name of the user for results and/or other official
54
56
    """
55
57
 
56
58
    if 'uid' not in props or props['uid'] is None:
57
 
        raise Exception, "No algorithm for creating uids yet!"
 
59
        raise NotImplementedError, "No algorithm for creating uids yet!"
58
60
        # uid = invent-uid
59
61
        # props['uid'] = uid
60
62
 
61
 
    common.makeuser.make_user_db(props['username'], props['uid'],
62
 
                                 props['password'], props['nick'],
63
 
                                 props['fullname'], props['rolenm'],
64
 
                                 props['studentid'])
 
63
    username = props['username']
 
64
    uid = props['uid']
 
65
    try:
 
66
        password = props['password']
 
67
    except KeyError:
 
68
        password = None
 
69
    try:
 
70
        email = props['email']
 
71
    except KeyError:
 
72
        email = None
 
73
    nick = props['nick']
 
74
    fullname = props['fullname']
 
75
    rolenm = props['rolenm']
 
76
    try:
 
77
        studentid = props['studentid']
 
78
    except KeyError:
 
79
        studentid = None
 
80
    common.makeuser.make_user_db(username, uid, password, email, nick,
 
81
                                 fullname, rolenm, studentid)
65
82
 
66
 
    return props['uid']
 
83
    return uid
67
84
 
68
85
def create_jail(props):
69
86
    """Create the jail for a user.