change password requirements

This commit is contained in:
Matthew Saunders Brown 2022-09-27 16:33:11 -07:00
parent 110fd8669f
commit 6df7482f0f

View File

@ -113,35 +113,39 @@ class Panel {
}
$character_class = 0;
if(strlen($password) < 15) {
if (preg_match('/[[:lower:]]/', $password)) {
$character_class = 0;
$character_class++;
if (preg_match('/[[:lower:]]/', $password)) {
}
$character_class++;
if (preg_match('/[[:upper:]]/', $password)) {
}
$character_class++;
if (preg_match('/[[:upper:]]/', $password)) {
}
$character_class++;
if (preg_match('/[[:digit:]]/', $password)) {
}
$character_class++;
if (preg_match('/[[:digit:]]/', $password)) {
}
$character_class++;
if (preg_match('/[[:punct:]]/', $password)) {
}
$character_class++;
if (preg_match('/[[:punct:]]/', $password)) {
}
$character_class++;
if ($character_class < 3) {
}
$messages[] = "Password must contain characters from at least three of the following four groups: Lower Case Letters, Uppler Case Leters, Numbers, Puncuation/Special Characters.";
if ($character_class < 3) {
$messages[] = "Passwords under 15 characters must contain characters from at least three of the following four groups: Lower Case Letters, Uppler Case Leters, Numbers, Puncuation/Special Characters. Passwords 15 or more characters long do not have any complexity requirements.";
}
}