+
+ if user is not None and user.is_authenticated():
+ if not user.is_active:
+ errors.append('This account is disabled.')
+ else:
+ if service is None:
+ # Normal internal success redirection.
+ logging.debug('Redirecting to %s', success_redirect)
+ return HttpResponseRedirect(success_redirect)
+ else:
+ # Create a service ticket and redirect.
+ ticket = create_service_ticket(request.user, service)
+ if service.find('?') == -1:
+ url = service + '?ticket=' + ticket.ticket
+ logging.debug('Redirecting to %s', url)
+ return HttpResponseRedirect(url)
+ else:
+ url = service + '&ticket=' + ticket.ticket
+ logging.debug('Redirecting to %s', url)
+ return HttpResponseRedirect(url)
+