From 6df7482f0f14798b0cbb3dad8c0d1c3ed1e37b35 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Tue, 27 Sep 2022 16:33:11 -0700 Subject: [PATCH] change password requirements --- panel/classes/Panel.php | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/panel/classes/Panel.php b/panel/classes/Panel.php index ec80027..11afc45 100644 --- a/panel/classes/Panel.php +++ b/panel/classes/Panel.php @@ -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."; + + } }