--- /tmp/dsg/dolibarr/htdocs/core/modules/security/generate/github_modGeneratePassNone.class.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/security/generate/client_modGeneratePassNone.class.php @@ -39,9 +39,9 @@ public $length; /** - * @var DoliDB Database handler. - */ - public $db; + * @var DoliDB Database handler. + */ + public $db; public $conf; public $lang; @@ -70,7 +70,7 @@ /** * Return description of module * - * @return string Description of text + * @return string Description of text */ public function getDescription() { @@ -81,7 +81,7 @@ /** * Return an example of password generated by this module * - * @return string Example of password + * @return string Example of password */ public function getExample() { @@ -91,7 +91,7 @@ /** * Build new password * - * @return string Return a new generated password + * @return string Return a new generated password */ public function getNewGeneratedPassword() { @@ -102,7 +102,7 @@ * Validate a password * * @param string $password Password to check - * @return int 0 if KO, >0 if OK + * @return int 0 if KO, >0 if OK */ public function validatePassword($password) { --- /tmp/dsg/dolibarr/htdocs/core/modules/security/generate/github_modGeneratePassPerso.class.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/security/generate/client_modGeneratePassPerso.class.php @@ -47,9 +47,9 @@ public $WithoutAmbi; /** - * @var DoliDB Database handler. - */ - public $db; + * @var DoliDB Database handler. + */ + public $db; public $conf; public $lang; @@ -81,8 +81,8 @@ $this->user = $user; if (empty($conf->global->USER_PASSWORD_PATTERN)) { - // default value (10carac, 1maj, 1digit, 1spe, 3 repeat, no ambi at auto generation. - dolibarr_set_const($db, "USER_PASSWORD_PATTERN", '10;1;1;1;3;1', 'chaine', 0, '', $conf->entity); + // default value (8carac, 1maj, 1digit, 1spe, 3 repeat, no ambi at auto generation. + dolibarr_set_const($db, "USER_PASSWORD_PATTERN", '8;1;1;1;3;1', 'chaine', 0, '', $conf->entity); } $this->Maj = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; @@ -145,22 +145,22 @@ { $pass = ""; for ($i = 0; $i < $this->NbMaj; $i++) { - // Y + // Y $pass .= $this->Maj[mt_rand(0, strlen($this->Maj) - 1)]; } for ($i = 0; $i < $this->NbNum; $i++) { - // X + // X $pass .= $this->Nb[mt_rand(0, strlen($this->Nb) - 1)]; } for ($i = 0; $i < $this->NbSpe; $i++) { - // @ + // @ $pass .= $this->Spe[mt_rand(0, strlen($this->Spe) - 1)]; } for ($i = strlen($pass); $i < $this->length2; $i++) { - // y + // y $pass .= $this->All[mt_rand(0, strlen($this->All) - 1)]; } @@ -211,8 +211,8 @@ * @param string $password Password to check * @return bool */ - private function consecutiveInterationSameCharacter($password) - { + private function consecutiveInterationSameCharacter($password) + { $last = ""; if (empty($this->NbRepeat)) return 1; @@ -228,7 +228,7 @@ continue; } - $count++; + $count++; if ($count > $this->NbRepeat) { return false; } --- /tmp/dsg/dolibarr/htdocs/core/modules/security/generate/github_modGeneratePassStandard.class.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/security/generate/client_modGeneratePassStandard.class.php @@ -39,9 +39,9 @@ public $length; /** - * @var DoliDB Database handler. - */ - public $db; + * @var DoliDB Database handler. + */ + public $db; public $conf; public $lang; @@ -59,7 +59,7 @@ public function __construct($db, $conf, $langs, $user) { $this->id = "standard"; - $this->length = 10; + $this->length = 8; $this->db = $db; $this->conf = $conf; @@ -70,18 +70,18 @@ /** * Return description of module * - * @return string Description of module + * @return string Description of module */ public function getDescription() { global $langs; - return $langs->trans("PasswordGenerationStandard", $this->length); + return $langs->trans("PasswordGenerationStandard"); } /** * Return an example of password generated by this module * - * @return string Example of password + * @return string Example of password */ public function getExample() { @@ -91,7 +91,7 @@ /** * Build new password * - * @return string Return a new generated password + * @return string Return a new generated password */ public function getNewGeneratedPassword() { @@ -122,15 +122,15 @@ return $password; } - /** - * Validate a password - * - * @param string $password Password to check - * @return int 0 if KO, >0 if OK - */ - public function validatePassword($password) - { - if (dol_strlen($password) < $this->length) return 0; - return 1; - } + /** + * Validate a password + * + * @param string $password Password to check + * @return int 0 if KO, >0 if OK + */ + public function validatePassword($password) + { + if (dol_strlen($password) < $this->length) return 0; + return 1; + } } --- /tmp/dsg/dolibarr/htdocs/core/modules/security/generate/github_modules_genpassword.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/security/generate/client_modules_genpassword.php @@ -30,63 +30,63 @@ */ abstract class ModeleGenPassword { - /** + /** * @var string Error code (or message) */ public $error = ''; - /** - * Return if a module can be used or not - * - * @return boolean true if module can be used - */ - public function isEnabled() - { - return true; - } + /** + * Return if a module can be used or not + * + * @return boolean true if module can be used + */ + public function isEnabled() + { + return true; + } - /** - * Return description of module - * - * @return string Description of text - */ - public function getDescription() - { - global $langs; - return $langs->trans("NoDescription"); - } + /** + * Return description of module + * + * @return string Description of text + */ + public function getDescription() + { + global $langs; + return $langs->trans("NoDescription"); + } - /** - * Return an example of password generated by this module - * - * @return string Example of password - */ - public function getExample() - { - global $langs; - $langs->load("bills"); - return $langs->trans("NoExample"); - } + /** + * Return an example of password generated by this module + * + * @return string Example of password + */ + public function getExample() + { + global $langs; + $langs->load("bills"); + return $langs->trans("NoExample"); + } /** * Build new password * - * @return string Return a new generated password + * @return string Return a new generated password */ - public function getNewGeneratedPassword() - { - global $langs; - return $langs->trans("NotAvailable"); - } + public function getNewGeneratedPassword() + { + global $langs; + return $langs->trans("NotAvailable"); + } /** * Validate a password * * @param string $password Password to check - * @return int 0 if KO, >0 if OK + * @return int 0 if KO, >0 if OK */ - public function validatePassword($password) - { - return 1; - } + public function validatePassword($password) + { + return 1; + } }