def shutdown_notebook(request):
# Make sure we have a logged in user
auth = request.registry.queryUtility(IAuthenticationPolicy)
username = auth.authenticated_userid(request)
if not username:
# This will trigger HTTP Basic Auth dialog, as per basic_challenge handler below
raise httpexceptions.HTTPForbidden("You need to be logged in. Hint: user / password")
_shutdown_notebook(request, username)
return HTTPFound(request.route_url("home"))
评论列表
文章目录