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

« back to all changes in this revision

Viewing changes to makeuser.py

  • Committer: dcoles
  • Date: 2008-08-07 06:46:32 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:989
Groups: Added userservice/assign_group call. This allows a user with the 
CAP_MANAGEGROUPS permission to assign a user into a group. This records the 
assignment in the database and then regenerates a svn-groups.conf file which 
specifies which users can access which repository.

This commit introduces the /groups repository (which means a groups directory 
will have to be created in repositories area and the apache config will have to 
be updated to allow the new dav repositories to work - see the changes to 
ivle-svn.conf/ivle-both.conf and install_proc for exact details). There is also 
a new parameter svn_group_conf in the config file so you need to run `setup.py 
config` too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
import sys
31
31
import os
32
 
import os.path
33
 
import pwd
34
32
import getopt
35
 
# Import modules from the website is tricky since they're in the www
36
 
# directory.
37
 
sys.path.append(os.path.join(os.getcwd(), 'www'))
38
 
import conf
39
 
import common.makeuser, common.db
 
33
import common.makeuser
40
34
 
41
35
# Requireds and optionals will be used to display the usage message
42
36
# AND do argument processing
84
78
    user['nick'] = user['fullname']
85
79
 
86
80
try:
87
 
    # Resolve the user's username into a UID
88
 
    # Create the user if it does not exist
89
 
    try:
90
 
        (_,_,uid,_,_,_,_) = pwd.getpwnam(login)
91
 
    except KeyError:
92
 
        if os.system("useradd '%s'" % login) != 0:
93
 
            raise Exception("Failed to add Unix user account")
94
 
        try:
95
 
            (_,_,uid,_,_,_,_) = pwd.getpwnam(login)
96
 
        except KeyError:
97
 
            raise Exception("Failed to add Unix user account")
98
 
    user['unixid'] = uid
99
 
    # Make the user's jail
100
 
    common.makeuser.make_jail(login, uid)
101
81
    # Make the user's database entry
102
82
    common.makeuser.make_user_db(**user)
103
83
except Exception, message: