1 from forum.authentication.base import AuthenticationConsumer, ConsumerTemplateContext, InvalidAuthentication
\r
2 from forms import ClassicLoginForm
\r
4 class LocalAuthConsumer(AuthenticationConsumer):
\r
5 def process_authentication_request(self, request):
\r
6 form_auth = ClassicLoginForm(request.POST)
\r
8 if form_auth.is_valid():
\r
9 return form_auth.get_user()
\r
11 raise InvalidAuthentication(" ".join(form_auth.errors.values()[0]))
\r
13 class LocalAuthContext(ConsumerTemplateContext):
\r
16 human_name = 'Local authentication'
\r
17 stack_item_template = 'modules/localauth/loginform.html'
\r
18 show_to_logged_in_user = False