From f7e71d88480ff1daf782836e8c1832dfe5772d1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Wed, 5 Nov 2014 16:23:10 +0100 Subject: [PATCH] Fix: checkstyle --- .../generate/modGeneratePassPerso.class.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php index aedc870560f..7440a357ea8 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -90,11 +90,12 @@ class modGeneratePassPerso extends ModeleGenPassword $this->NbRepeat = $tabConf[4]; $this->WithoutAmbi = $tabConf[5]; - if($this->WithoutAmbi){ - $this->Maj = str_replace($this->Ambi,"",$this->Maj ); - $this->Min = str_replace($this->Ambi,"",$this->Min ); - $this->Nb = str_replace($this->Ambi,"",$this->Nb ); - $this->Spe = str_replace($this->Ambi,"",$this->Spe ); + if ($this->WithoutAmbi) + { + $this->Maj = str_replace($this->Ambi,"",$this->Maj); + $this->Min = str_replace($this->Ambi,"",$this->Min); + $this->Nb = str_replace($this->Ambi,"",$this->Nb); + $this->Spe = str_replace($this->Ambi,"",$this->Spe); } $this->All = str_shuffle($this->Maj. $this->Min. $this->Nb. $this->Spe); @@ -148,11 +149,13 @@ class modGeneratePassPerso extends ModeleGenPassword $pass .= $this->All[rand(0,strlen($this->All) -1)]; } - $pass = str_shuffle($pass) ; + $pass = str_shuffle($pass); - if($this->validatePassword($pass)) { + if ($this->validatePassword($pass)) + { return $pass; } + return $this->getNewGeneratedPassword(); } -- GitLab