Hi,
I have been working with Django for two years, in order to fit my
systems requirements i have changes some parts of the Django code, One
of them the Authorization Framework i have added the next features:

-Password Strength Validation with cracklib.
-Maximum Login attempts.

I want to ask for those features and merge my code with the official
Django code.

This is my code for the password strength validation:

Line 156 from Method clean_new_password2(self) from /django/contrib/
auth/forms.py:

    def clean_new_password2(self):
        password1 = self.cleaned_data.get('new_password1')
        password2 = self.cleaned_data.get('new_password2')
        if password1 and password2:
            import crack
            # Increase the number of credits required from the default of 8
if you want.
            crack.min_length = 8
            try:
                crack.VeryFascistCheck(password1)
            except ValueError, message:
              raise forms.ValidationError("Weak Password, %s." %
str(message))

            if password1 != password2:
                raise forms.ValidationError("Passwords do not match.
Please try again.")
        return password2


Original Method:

    def clean_new_password2(self):
        password1 = self.cleaned_data.get('new_password1')
        password2 = self.cleaned_data.get('new_password2')
        if password1 and password2:
            if password1 != password2:
                raise forms.ValidationError(_("The two password fields
didn't match."))
        return password2


-That code i have published includes the import statement inside the
method, i did that only to avoid post the entire file here. The code i
have is more clean.
-It requires cracklib and python-cracklib


I have more code to publish but i want to start with this.
Opinions?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to