Commit b4f7ead1043f39bbcbc6222f36e0792806ca3589

Authored by bshuttle
1 parent ac9b09a8

passwords need to have a minimum length (6) as defined in config.ini (passwordLength)


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4599 c91229c3-7414-0410-bfa2-8a42b809f60b
config/config.ini
... ... @@ -128,4 +128,7 @@ pstotext = pstotext
128 128 catdoc = catdoc
129 129 antiword = antiword
130 130  
131   -
  131 +[user_prefs]
  132 +; minimum password length on password-setting
  133 +; could be moved into DB-auth-config
  134 +passwordLength = 6
... ...
preferences.php
... ... @@ -78,6 +78,14 @@ class PreferencesDispatcher extends KTStandardDispatcher {
78 78 } else if ($password !== $confirm_password) {
79 79 $this->errorRedirectToMain(_("The passwords you specified do not match."));
80 80 }
  81 +
  82 + $KTConfig =& KTConfig::getSingleton();
  83 + $minLength = ((int) $KTConfig->get('user_prefs/passwordLength', 6));
  84 +
  85 + if (strlen($password) < $minLength) {
  86 + $this->errorRedirectToMain(sprintf(_("Your password is too short - passwords must be at least %d characters long."), $minLength));
  87 + }
  88 +
81 89 // FIXME more validation would be useful.
82 90 // validated and ready..
83 91 $this->startTransaction();
... ...