1 from django import forms
2 from django.contrib.auth.forms import AuthenticationForm
3 from django.contrib.auth import authenticate
5 from utils import create_login_ticket
7 class LoginForm(forms.Form):
8 username = forms.CharField(max_length=30)
9 password = forms.CharField(widget=forms.PasswordInput)
10 #warn = forms.BooleanField(required=False) # TODO: Implement
11 lt = forms.CharField(widget=forms.HiddenInput, initial=create_login_ticket)
12 def __init__(self, service=None, renew=None, gateway=None, request=None, *args, **kwargs):
13 super(LoginForm, self).__init__(*args, **kwargs)
14 self.request = request
15 if service is not None:
16 self.fields['service'] = forms.CharField(widget=forms.HiddenInput, initial=service)