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

« back to all changes in this revision

Viewing changes to lib/common/makeuser.py

  • Committer: mattgiuca
  • Date: 2008-07-15 09:36:39 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:878
lib/common/makeuser.py: When a new user is added (either by hand or by
    usrmgt), pulls the subject codes from afar and adds enrolments to the DB.

This performs the same function as ./enrolallusers, but does it precisely when
the user is created, to avoid having to run enrolallusers just to get new
users into subjects (though you still have to run enrolallusers whenever new
subjects become available, or if an existing user enrols in new subjects).

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
import logging
47
47
import conf
48
48
import db
 
49
import pulldown_subj
49
50
 
50
51
def chown_to_webserver(filename):
51
52
    """
353
354
    "password" argument, which will be hashed internally.
354
355
    Also do not supply a state. All users are created in the "no_agreement"
355
356
    state.
 
357
    Also pulls the user's subjects using the configured subject pulldown
 
358
    module, and adds enrolments to the DB.
356
359
    Throws an exception if the user already exists.
357
360
    """
358
361
    dbconn = db.DB()
375
378
    if create == "c":
376
379
        chown_to_webserver(conf.svn_auth_local)
377
380
 
 
381
    # Pulldown subjects and add enrolments
 
382
    pulldown_subj.enrol_user(kwargs['login'])
 
383
 
378
384
def mount_jail(login):
379
385
    # This is where we'll mount to...
380
386
    destdir = os.path.join(conf.jail_base, login)