Added ability to have password policy and password expiration

This commit is contained in:
Pinga 2025-02-11 15:50:29 +02:00
parent e0eeaed83c
commit 2620dfd7f3
5 changed files with 51 additions and 3 deletions

View file

@ -115,6 +115,11 @@ class RegistrarsController extends Controller
return $response->withHeader('Location', '/registrar/create')->withStatus(302);
}
if (!checkPasswordComplexity($data['panelPassword'])) {
$this->container->get('flash')->addMessage('error', 'Password too weak. Use a stronger password');
return $response->withHeader('Location', '/registrar/create')->withStatus(302);
}
$db->beginTransaction();
try {
@ -650,7 +655,12 @@ class RegistrarsController extends Controller
$this->container->get('flash')->addMessage('error', $errorText);
return $response->withHeader('Location', '/registrar/update/'.$registrar)->withStatus(302);
}
if (!checkPasswordComplexity($data['panelPassword'])) {
$this->container->get('flash')->addMessage('error', 'Password too weak. Use a stronger password');
return $response->withHeader('Location', '/registrar/update/'.$registrar)->withStatus(302);
}
if (!empty($_SESSION['registrars_user_email'])) {
$regEmail = $_SESSION['registrars_user_email'][0];
} else {