41
41
login = props['login']
43
store = ivle.database.get_store()
47
# FIXME: check we're pending
49
# Get the full User object from the db associated with this
50
user = ivle.database.User.get_by_login(store, login)
52
# make svn config/auth
54
repopath = os.path.join(ivle.conf.svn_repo_path, 'users', login)
55
logging.debug("Creating user's Subversion repository")
56
ivle.makeuser.make_svn_repo(repopath, throw_on_error=True)
58
rebuild_svn_config(props)
60
logging.debug("Adding Subversion authentication")
61
passwd = ivle.makeuser.make_svn_auth(store, login,
63
logging.debug("passwd: %s" % passwd)
65
logging.debug("Creating jail")
66
ivle.makeuser.make_jail(login, user.unixid, svn_pass=passwd)
68
logging.info("Enabling user")
69
user.state = u'enabled'
73
return {"response": "okay"}
78
def rebuild_svn_config(props):
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(login, user.unixid, svn_pass=passwd)
62
logging.info("Enabling user")
63
user.state = u'enabled'
65
return {"response": "okay"}
67
def rebuild_svn_config(store, props):
79
68
"""Rebuilds the svn config file
81
70
response (okay, failure)
84
ivle.makeuser.rebuild_svn_config()
73
ivle.makeuser.rebuild_svn_config(store)
85
74
except Exception, e:
86
75
logging.warning('Rebuild of Subversion authorization config failed!')
87
76
return{'response': 'failure', 'msg': repr(e)}
89
78
return {'response': 'okay'}
91
def rebuild_svn_group_config(props):
80
def rebuild_svn_group_config(store, props):
92
81
"""Rebuilds the svn group config file
94
83
response (okay, failure)
97
ivle.makeuser.rebuild_svn_group_config()
86
ivle.makeuser.rebuild_svn_group_config(store)
98
87
except Exception, e:
100
89
'Rebuild of Subversion group authorization config failed!')