def _check_id(request, server, openid_request): identity = get_identity() if not request.user.is_authenticated() or \ not request.user.is_superuser or \ openid_request.identity != identity: return http_openid_response(server, openid_request.answer(False)) if TrustRoot.objects.filter(url=openid_request.trust_root).count() > 0: return http_openid_response(server, openid_request.answer(True), True) else: if openid_request.immediate: return http_openid_response(server, openid_request.answer(False)) request.session['check_id_request'] = openid_request return render_to_response('vooid/confirm.html', { 'url': openid_request.trust_root, })
def process_request(self, request): if utils.absolute_url(request.path) == utils.get_identity() and \ 'application/xrds+xml' in request.META.get('HTTP_ACCEPT', ''): return views.yadis(request)
def process_response(self, request, response): if utils.absolute_url(request.path) == utils.get_identity(): response['X-XRDS-Location'] = utils.absolute_url(reverse(views.yadis)) return response
def yadis(request): return render_to_response('vooid/yadis.xml', { 'endpoint': absolute_url(reverse(endpoint)), 'identity': get_identity(), }, mimetype='application/xrds+xml')