diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php index af08ae53392..96041bcac2c 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -1,6 +1,7 @@ - * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> +/* Copyright (C) 2006-2011 Laurent Destailleur + * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> + * Copyright (C) 2017 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -98,7 +99,10 @@ class modGeneratePassPerso extends ModeleGenPassword $this->Spe = str_replace($this->Ambi,"",$this->Spe); } - $this->All = str_shuffle($this->Maj. $this->Min. $this->Nb. $this->Spe); + $pattern = $this->Min . (! empty($this->NbMaj)?$this->Maj:'') . (! empty($this->NbNum)?$this->Nb:'') . (! empty($this->NbSpe)?$this->Spe:''); + $this->All = str_shuffle($pattern); + + //$this->All = str_shuffle($this->Maj. $this->Min. $this->Nb. $this->Spe); //$this->All = $this->Maj. $this->Min. $this->Nb. $this->Spe; //$this->All = $this->Spe;