Hotfix for password update

This commit is contained in:
Pinga 2025-02-19 14:11:44 +02:00
parent 955dd6ffe0
commit c923aaceb0
2 changed files with 10 additions and 6 deletions

View file

@ -657,10 +657,12 @@ class RegistrarsController extends Controller
return $response->withHeader('Location', '/registrar/update/'.$registrar)->withStatus(302); return $response->withHeader('Location', '/registrar/update/'.$registrar)->withStatus(302);
} }
if (isset($data['panelPassword']) && $data['panelPassword']) {
if (!checkPasswordComplexity($data['panelPassword'])) { if (!checkPasswordComplexity($data['panelPassword'])) {
$this->container->get('flash')->addMessage('error', 'Password too weak. Use a stronger password'); $this->container->get('flash')->addMessage('error', 'Password too weak. Use a stronger password');
return $response->withHeader('Location', '/registrar/update/'.$registrar)->withStatus(302); return $response->withHeader('Location', '/registrar/update/'.$registrar)->withStatus(302);
} }
}
if (!empty($_SESSION['registrars_user_email'])) { if (!empty($_SESSION['registrars_user_email'])) {
$regEmail = $_SESSION['registrars_user_email'][0]; $regEmail = $_SESSION['registrars_user_email'][0];

View file

@ -312,10 +312,12 @@ class UsersController extends Controller
return $response->withHeader('Location', '/user/update/'.$old_username)->withStatus(302); return $response->withHeader('Location', '/user/update/'.$old_username)->withStatus(302);
} }
if (!empty($password)) {
if (!checkPasswordComplexity($password)) { if (!checkPasswordComplexity($password)) {
$this->container->get('flash')->addMessage('error', 'Password too weak. Use a stronger password'); $this->container->get('flash')->addMessage('error', 'Password too weak. Use a stronger password');
return $response->withHeader('Location', '/user/update/'.$old_username)->withStatus(302); return $response->withHeader('Location', '/user/update/'.$old_username)->withStatus(302);
} }
}
// Check if username already exists (excluding the current user) // Check if username already exists (excluding the current user)
if ($username && $username !== $old_username) { if ($username && $username !== $old_username) {