diff MoinMoin/config/multiconfig.py @ 2443:b4c44e5be9e8

password_checker: more builtin checks, more tests
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 20 Jul 2007 17:45:20 +0200
parents 81afe010284f
children 45641cbe7729
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py	Fri Jul 20 16:10:17 2007 +0200
+++ b/MoinMoin/config/multiconfig.py	Fri Jul 20 17:45:20 2007 +0200
@@ -447,15 +447,18 @@
         try:
             # in any case, do a very simple built-in check to avoid the worst passwords
             if len(password) < 6:
-                raise ValueError("Password too short!")
+                raise ValueError("Password too short.")
+            if len(set(password)) < 4:
+                raise ValueError("Password has not enough different characters.")
 
             username_lower = username.lower()
             password_lower = password.lower()
             if username in password or password in username or \
                username_lower in password_lower or password_lower in username_lower:
-                raise ValueError("Password too easy (containment)")
+                raise ValueError("Password too easy (containment).")
 
             keyboards = (ur"`1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./", # US kbd
+                         ur"^1234567890ß´qwertzuiopü+asdfghjklöä#yxcvbnm,.-", # german kbd
                         ) # add more keyboards!
             for kbd in keyboards:
                 rev_kbd = kbd[::-1]