diff --git a/cp/app/Controllers/RegistrarsController.php b/cp/app/Controllers/RegistrarsController.php index 8492101..6cf7496 100644 --- a/cp/app/Controllers/RegistrarsController.php +++ b/cp/app/Controllers/RegistrarsController.php @@ -657,9 +657,11 @@ class RegistrarsController extends Controller 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 (isset($data['panelPassword']) && $data['panelPassword']) { + 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'])) { diff --git a/cp/app/Controllers/UsersController.php b/cp/app/Controllers/UsersController.php index a01bbf9..f938607 100644 --- a/cp/app/Controllers/UsersController.php +++ b/cp/app/Controllers/UsersController.php @@ -312,9 +312,11 @@ class UsersController extends Controller return $response->withHeader('Location', '/user/update/'.$old_username)->withStatus(302); } - if (!checkPasswordComplexity($password)) { - $this->container->get('flash')->addMessage('error', 'Password too weak. Use a stronger password'); - return $response->withHeader('Location', '/user/update/'.$old_username)->withStatus(302); + if (!empty($password)) { + if (!checkPasswordComplexity($password)) { + $this->container->get('flash')->addMessage('error', 'Password too weak. Use a stronger password'); + return $response->withHeader('Location', '/user/update/'.$old_username)->withStatus(302); + } } // Check if username already exists (excluding the current user)