163
163
logging.debug("Creating jail")
164
164
common.makeuser.make_jail(login, details.unixid, svn_pass=passwd)
166
# Check out the repositories into the student's home dir
167
# FIXME: Call do_checkout instead of replicating this code.
168
# (do_checkout currently doesn't work)
171
logging.debug("Checking out directories in the jail")
173
svn.checkout(conf.svn_addr + login + "/stuff",
174
common.studpath.url_to_local(login + "/stuff")[1])
175
os.system("chown -R %d:%d %s" \
176
% (details.unixid, details.unixid,
177
common.studpath.url_to_local(login + "/stuff")[1]))
178
except Exception, exc:
179
logging.warning("While mkdiring stuff: %s" % str(exc))
182
svn.checkout(conf.svn_addr + login + "/info1",
183
common.studpath.url_to_local(login + "/info1")[1])
184
os.system("chown -R %d:%d %s" \
185
% (details.unixid, details.unixid,
186
common.studpath.url_to_local(login + "/info1")[1]))
187
except Exception, exc:
188
logging.warning("While mkdiring info1: %s" % str(exc))
166
do_checkout(props, svn_pass=passwd)
191
168
# FIXME: should this be nicer?
192
169
os.system("chown -R %d:%d %s" \
193
170
% (details.unixid, details.unixid,
194
171
common.studpath.url_to_local(login)[1]))
197
173
logging.info("Enabling user")
198
174
db.update_user(login, state='enabled')
213
189
Return Value: None
215
# XXX / FIXME: This doesn't work - cannot get passwd
216
# (activate_me creates passwd, other svn stuff gets it from jailconf - we
217
# can't access either at this point).
219
191
login = props['login']
193
# If svn_pass isn't supplied, grab it from the DB
196
user = db.get_user(login)
197
svn_pass = user.svn_pass
220
200
svn = pysvn.Client()
221
svn.callback_get_login = partial(get_login, login, passwd)
223
if conf.svn_addr[-1] != '/':
224
conf.svn_addr = conf.svn_addr + "/"
201
svn.callback_get_login = partial(get_login, login, svn_pass)
203
if conf.svn_addr[-1] != os.sep:
204
conf.svn_addr += os.sep
228
208
logging.debug("Checking out directories in the jail")
230
210
svn.checkout(conf.svn_addr + login + "/stuff",
231
211
common.studpath.url_to_local(login + "/stuff")[1])
232
212
os.system("chown -R %d:%d %s" \
233
% (details.unixid, details.unixid,
213
% (user.unixid, user.unixid,
234
214
common.studpath.url_to_local(login + "/stuff")[1]))
235
215
except Exception, exc:
236
216
logging.warning("While mkdiring stuff: %s" % str(exc))
239
219
svn.checkout(conf.svn_addr + login + "/info1",
240
220
common.studpath.url_to_local(login + "/info1")[1])
241
221
os.system("chown -R %d:%d %s" \
242
% (details.unixid, details.unixid,
222
% (user.unixid, user.unixid,
243
223
common.studpath.url_to_local(login + "/info1")[1]))
244
224
except Exception, exc:
245
225
logging.warning("While mkdiring info1: %s" % str(exc))
248
230
return {"response": "okay"}