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

« back to all changes in this revision

Viewing changes to bin/ivle-makeuser

  • Committer: Nick Chadwick
  • Date: 2009-05-12 11:49:31 UTC
  • mto: This revision was merged to the branch mainline in revision 1247.
  • Revision ID: chadnickbok@gmail.com-20090512114931-k6rgwieyvbg8ld07
Removed non-functional links to delete projects and grant extensions.

Also fixed a line in the javascript which was accidentally commented out.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
import os
32
32
import getopt
33
33
 
 
34
if os.getuid() != 0:
 
35
    print "Must run %s as root." % os.path.basename(sys.argv[0])
 
36
    sys.exit(1)
 
37
 
 
38
from ivle.config import Config
34
39
from ivle.database import get_store, User
35
40
from ivle.pulldown_subj import enrol_user
36
41
 
37
42
# Requireds and optionals will be used to display the usage message
38
43
# AND do argument processing
39
44
# The names here must correspond to the fields in the database.
40
 
requireds = ["login", "fullname", "rolenm"]
 
45
requireds = ["login", "fullname"]
41
46
optionals = [
42
47
    ('p', 'password', "Cleartext password for this user"),
43
48
    ('n', 'nick', "Display name (defaults to <fullname>)"),
55
60
        print t + (' ' * max(28 - len(t), 2)) + desc
56
61
    sys.exit(1)
57
62
 
58
 
if os.getuid() != 0:
59
 
    print "Must run %s as root." % os.path.basename(sys.argv[0])
60
 
    sys.exit(1)
61
 
 
62
63
shorts = ''.join([o[0] + ":" for o in optionals])
63
64
longs = [o[1] + "=" for o in optionals]
64
65
opts, args = getopt.gnu_getopt(sys.argv[1:], shorts, longs)
80
81
if 'nick' not in user:
81
82
    user['nick'] = user['fullname']
82
83
 
83
 
store = get_store()
 
84
store = get_store(Config())
84
85
 
85
86
try:
86
87
    # Make the user's database entry