diff MoinMoin/action/newaccount.py @ 2431:58260d360f5c

password_checker (simple builtin test, optionally using python-crack lib)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 20 Jul 2007 03:46:38 +0200
parents b9feee61d28e
children f3e3ffa68a7f
line wrap: on
line diff
--- a/MoinMoin/action/newaccount.py	Fri Jul 20 00:57:57 2007 +0200
+++ b/MoinMoin/action/newaccount.py	Fri Jul 20 03:46:38 2007 +0200
@@ -43,6 +43,12 @@
     password = form.get('password', [''])[0]
     password2 = form.get('password2', [''])[0]
 
+    pw_checker = request.cfg.password_checker
+    if pw_checker:
+        pw_error = pw_checker(theuser.name, password)
+        if pw_error:
+            return _("Password not acceptable: %s") % pw_error
+
     # Check if password is given and matches with password repeat
     if password != password2:
         return _("Passwords don't match!")