def uptime_openacs(request): # we want to do this work - if it works then the site should # be generally ok. try: garbage = show_front_page(request) except e: return HttpResponse(str(e)) return HttpResponse("success")
def post_login_form(s, request): s.lform = LoginForm(request.POST, prefix="login") if s.lform.is_valid(): cleaned_data = s.lform.cleaned_data user = authenticate(username=cleaned_data["username"], password=cleaned_data["password"]) if not user: s.status = "failed" else: if user.is_active: s.first_time_user = user.last_login == user.date_joined login(request, user) # check if this is a first time login if request.user.is_authenticated() and s.first_time_user: front_page = get_object_or_404(FrontPage, title=settings.NEW_MEMBERS_FRONTPAGE_TITLE) s.response = show_front_page(request, front_page=front_page) else: # redirect normal users to frontpage s.response = HttpResponseRedirect("/") else: s.status = "failed" # TODO: seperate message for non active users? else: s.status = "lform_not_valid"