# Path: djam/views/generic.py
# class FormView(FloppyformsMixin, RiffViewMixin, generic.FormView):
#     pass
# 
# class TemplateView(RiffViewMixin, generic.TemplateView):
#     pass


import urlparse
from django.contrib.auth import login, logout
from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm
from django.contrib.sites.models import Site
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext as _
from djam.views.generic import FormView, TemplateView

        # Heavier security check -- don't allow redirection to a different
        # host.
        elif netloc and netloc != self.request.get_host():
            redirect_to = self.riff.base_riff.get_default_url()

        # Okay, security checks complete. Log the user in.
        login(self.request, form.get_user())

        if self.request.session.test_cookie_worked():
            self.request.session.delete_test_cookie()

        return HttpResponseRedirect(redirect_to)

    def get_context_data(self, **kwargs):
        context = super(LoginView, self).get_context_data(**kwargs)
        context.update({
            'redirect_to': self.redirect_to,
            'redirect_field_name': self.redirect_field_name,
            'site': Site.objects.get_current(),
        })
        return context

    def get_crumbs(self):
        return [
            (None, self.riff.base_riff.display_name),
            (None, _('Login')),
        ]



# Path: djam/views/generic.py
# class FormView(FloppyformsMixin, RiffViewMixin, generic.FormView):
#     pass
# 
# class TemplateView(RiffViewMixin, generic.TemplateView):
#     pass


# Path: djam/views/auth.py
import urlparse
from django.contrib.auth import login, logout
from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm
from django.contrib.sites.models import Site
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext as _
from djam.views.generic import FormView, TemplateView


        # Heavier security check -- don't allow redirection to a different
        # host.
        elif netloc and netloc != self.request.get_host():
            redirect_to = self.riff.base_riff.get_default_url()

        # Okay, security checks complete. Log the user in.
        login(self.request, form.get_user())

        if self.request.session.test_cookie_worked():
            self.request.session.delete_test_cookie()

        return HttpResponseRedirect(redirect_to)

    def get_context_data(self, **kwargs):
        context = super(LoginView, self).get_context_data(**kwargs)
        context.update({
            'redirect_to': self.redirect_to,
            'redirect_field_name': self.redirect_field_name,
            'site': Site.objects.get_current(),
        })
        return context

    def get_crumbs(self):
        return [
            (None, self.riff.base_riff.display_name),
            (None, _('Login')),
        ]



class LogoutView(TemplateView):