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

« back to all changes in this revision

Viewing changes to ivle/makeuser.py

  • Committer: Matt Giuca
  • Date: 2009-02-24 08:00:43 UTC
  • mto: This revision was merged to the branch mainline in revision 1119.
  • Revision ID: matt.giuca@gmail.com-20090224080043-gfuml089mysw02lk
Generic style: h1 is now rendered specially, as a golden bar along the top.
    Note that this breaks on all pages that use it, because they will render
    the bar inside padding. It needs to be moved outside the padding.

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
    """
80
80
    users = store.find(ivle.database.User)
81
81
    groups = {}
82
 
    # TODO: Populate groups with per-offering tutors/lecturers/etc.
 
82
    for u in users:
 
83
        role = str(u.role)
 
84
        if role not in groups:
 
85
            groups[role] = []
 
86
        groups[role].append(u.login)
83
87
    f = open(ivle.conf.svn_conf + ".new", "w")
84
88
    f.write("# IVLE SVN Repositories Configuration\n")
85
89
    f.write("# Auto-generated on %s\n" % time.asctime())
193
197
        raise Exception("Must run make_jail as root")
194
198
    
195
199
    # tempdir is for putting backup homes in
196
 
    tempdir = os.path.join(ivle.conf.jail_src_base, '__temp__')
 
200
    tempdir = os.path.join(ivle.conf.jail_base, '__temp__')
197
201
    if not os.path.exists(tempdir):
198
202
        os.makedirs(tempdir)
199
203
    elif not os.path.isdir(tempdir):
223
227
        # Change the ownership of all the files to the right unixid
224
228
        logging.debug("chown %s's home directory files to uid %d"
225
229
            %(user.login, user.unixid))
226
 
        os.spawnvp(os.P_WAIT, 'chown', ['chown', '-R', '%d:%d' % (user.unixid,
227
 
                                        user.unixid), userhomedir])
 
230
        os.chown(userhomedir, user.unixid, user.unixid)
 
231
        for root, dirs, files in os.walk(userhomedir):
 
232
            for fsobj in dirs + files:
 
233
                os.chown(os.path.join(root, fsobj), user.unixid, user.unixid)
228
234
    else:
229
235
        # No user jail exists
230
236
        # Set up the user's home directory