25 require_once DOL_DOCUMENT_ROOT.
'/core/modules/security/generate/modules_genpassword.php';
38 public $picto =
'fa-shield-alt';
74 $this->
id =
"standard";
80 $this->langs = $langs;
92 return $langs->trans(
"PasswordGenerationStandard", $this->length);
116 $possible =
"0123456789qwertyuiopasdfghjklzxcvbnmASDFGHJKLZXCVBNMQWERTYUIOP";
122 while ($i < $this->length) {
124 if (function_exists(
'random_int')) {
125 $char = substr($possible, random_int(0,
dol_strlen($possible) - 1), 1);
127 $char = substr($possible, mt_rand(0,
dol_strlen($possible) - 1), 1);
130 if (substr_count($password, $char) <= 6) {
152 $langs->load(
"other");
153 $this->error = $langs->trans(
"YourPasswordMustHaveAtLeastXChars", $this->length2);