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

« back to all changes in this revision

Viewing changes to makeuser.py

  • Committer: drtomc
  • Date: 2008-02-14 23:37:08 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:467
makeuser: Add some of the helper functions for activating users.
setup: Add some missing svn config.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
import conf
38
38
import common.makeuser
39
39
 
40
 
if len(sys.argv) <= 5:
41
 
    print "Usage: python makeuser.py <username> <password> <nick> " \
42
 
        "<fullname> <rolenm> [<studentid>]"
 
40
if len(sys.argv) <= 6:
 
41
    print "Usage: python makeuser.py <username> <password> <email> " \
 
42
        "<nick> <fullname> <rolenm> [<studentid>]"
43
43
    sys.exit()
44
44
 
45
45
if os.getuid() != 0:
48
48
 
49
49
username = sys.argv[1]
50
50
password = sys.argv[2]
51
 
nick = sys.argv[3]
52
 
fullname = sys.argv[4]
53
 
rolenm = sys.argv[5]
54
 
if len(sys.argv) > 6:
55
 
    studentid = sys.argv[6]
 
51
email = sys.argv[3]
 
52
nick = sys.argv[4]
 
53
fullname = sys.argv[5]
 
54
rolenm = sys.argv[6]
 
55
if len(sys.argv) > 7:
 
56
    studentid = sys.argv[7]
56
57
else:
57
58
    studentid = None
58
59
 
71
72
    # Make the user's jail
72
73
    common.makeuser.make_jail(username, uid)
73
74
    # Make the user's database entry
74
 
    common.makeuser.make_user_db(username, uid, password, nick, fullname,
75
 
        rolenm, studentid)
 
75
    common.makeuser.make_user_db(username, password, uid, email, nick,
 
76
        fullname, rolenm, studentid)
76
77
except Exception, message:
77
78
    print "Error: " + str(message)
78
79
    sys.exit(1)