dolibarr  21.0.0-alpha
Public Member Functions | Private Member Functions | List of all members
modGeneratePassPerso Class Reference

Class to generate a password according to personal rules. More...

Inheritance diagram for modGeneratePassPerso:
Inheritance graph
[legend]
Collaboration diagram for modGeneratePassPerso:
Collaboration graph
[legend]

Public Member Functions

 __construct ($db, $conf, $langs, $user)
 Constructor. More...
 
 getDescription ()
 Return description of module. More...
 
 getExample ()
 Return an example of password generated by this module. More...
 
 getNewGeneratedPassword ()
 Build new password. More...
 
 validatePassword ($password)
 Validate a password. More...
 
 consecutiveIterationSameCharacter ($password)
 Check the consecutive iterations of the same character. More...
 
- Public Member Functions inherited from ModeleGenPassword
 isEnabled ()
 Return if a module can be used or not. More...
 

Private Member Functions

 initAll ()
 Init the property ->All and clean ->Maj, ->Min, ->Nb and ->Spe with list of valid chars. More...
 

Detailed Description

Class to generate a password according to personal rules.

Definition at line 34 of file modGeneratePassPerso.class.php.

Constructor & Destructor Documentation

◆ __construct()

modGeneratePassPerso::__construct (   $db,
  $conf,
  $langs,
  $user 
)

Constructor.

Parameters
DoliDB$dbDatabase handler
Conf$confHandler de conf
Translate$langsHandler de langue
User$userHandler du user connected

Definition at line 70 of file modGeneratePassPerso.class.php.

References conf(), dolibarr_set_const(), getDolGlobalString(), and user.

Member Function Documentation

◆ consecutiveIterationSameCharacter()

modGeneratePassPerso::consecutiveIterationSameCharacter (   $password)

Check the consecutive iterations of the same character.

Parameters
string$passwordPassword to check
Returns
bool False if the number doesn't match the maximum consecutive value allowed.

Definition at line 243 of file modGeneratePassPerso.class.php.

◆ getDescription()

modGeneratePassPerso::getDescription ( )

Return description of module.

Returns
string Description of text

Reimplemented from ModeleGenPassword.

Definition at line 123 of file modGeneratePassPerso.class.php.

◆ getExample()

modGeneratePassPerso::getExample ( )

Return an example of password generated by this module.

Returns
string Example of password

Reimplemented from ModeleGenPassword.

Definition at line 134 of file modGeneratePassPerso.class.php.

References getNewGeneratedPassword().

◆ getNewGeneratedPassword()

modGeneratePassPerso::getNewGeneratedPassword ( )

Build new password.

Returns
string Return a new generated password

@phan-suppress PhanPossiblyInfiniteRecursionSameParams

Reimplemented from ModeleGenPassword.

Definition at line 146 of file modGeneratePassPerso.class.php.

References initAll().

Referenced by getExample().

◆ initAll()

modGeneratePassPerso::initAll ( )
private

Init the property ->All and clean ->Maj, ->Min, ->Nb and ->Spe with list of valid chars.

Returns
void

Definition at line 105 of file modGeneratePassPerso.class.php.

Referenced by getNewGeneratedPassword().

◆ validatePassword()

modGeneratePassPerso::validatePassword (   $password)

Validate a password.

This function is called by User->setPassword() and internally to validate that the password matches the constraints.

Parameters
string$passwordPassword to check
Returns
int 0 if KO, >0 if OK

Reimplemented from ModeleGenPassword.

Definition at line 187 of file modGeneratePassPerso.class.php.


The documentation for this class was generated from the following file: