41
41
login = props['login']
43
# FIXME: check we're pending
45
# Get the full User object from the db associated with this
46
user = ivle.database.User.get_by_login(store, login)
48
# make svn config/auth
49
repopath = os.path.join(ivle.conf.svn_repo_path, 'users', login)
50
logging.debug("Creating user's Subversion repository")
51
ivle.makeuser.make_svn_repo(repopath, throw_on_error=True)
53
rebuild_svn_config(store, props)
55
logging.debug("Adding Subversion authentication")
56
passwd = ivle.makeuser.make_svn_auth(store, login,
59
logging.debug("Creating jail")
60
ivle.makeuser.make_jail(user)
62
logging.info("Enabling user")
63
user.state = u'enabled'
65
return {"response": "okay"}
67
def rebuild_svn_config(store, props):
47
# FIXME: check we're pending
49
details = db.get_user(login)
51
# make svn config/auth
53
repopath = os.path.join(ivle.conf.svn_repo_path, 'users', login)
54
logging.debug("Creating user's Subversion repository")
55
ivle.makeuser.make_svn_repo(repopath, throw_on_error=True)
57
rebuild_svn_config(props)
59
logging.debug("Adding Subversion authentication")
60
passwd = ivle.makeuser.make_svn_auth(login, throw_on_error=True)
61
logging.debug("passwd: %s" % passwd)
63
logging.debug("Creating jail")
64
ivle.makeuser.make_jail(login, details.unixid, svn_pass=passwd)
66
logging.info("Enabling user")
67
db.update_user(login, state='enabled')
69
return {"response": "okay"}
74
def rebuild_svn_config(props):
68
75
"""Rebuilds the svn config file
70
77
response (okay, failure)
73
ivle.makeuser.rebuild_svn_config(store)
80
ivle.makeuser.rebuild_svn_config()
74
81
except Exception, e:
75
82
logging.warning('Rebuild of Subversion authorization config failed!')
76
83
return{'response': 'failure', 'msg': repr(e)}
78
85
return {'response': 'okay'}
80
def rebuild_svn_group_config(store, props):
87
def rebuild_svn_group_config(props):
81
88
"""Rebuilds the svn group config file
83
90
response (okay, failure)
86
ivle.makeuser.rebuild_svn_group_config(store)
93
ivle.makeuser.rebuild_svn_group_config()
87
94
except Exception, e:
89
96
'Rebuild of Subversion group authorization config failed!')
92
99
return {'response': 'okay'}
94
def create_group_repository(store, props):
101
def create_group_repository(props):
95
102
"""Creates on disk repository for the given group
96
103
Expected properties:
97
104
subj_short_name, year, semester, groupnm