You are here

function genpass_algorithm_module in Generate Password 8

Same name and namespace in other branches
  1. 6 genpass.module \genpass_algorithm_module()
  2. 7 genpass.module \genpass_algorithm_module()

Return the currently activated module for generating passwords.

Does some validation to make sure the variable contains a valid module name.

Return value

string The name of the module whose implementation of hook_password is currently the preferred implementation.

2 calls to genpass_algorithm_module()
genpass_form_alter in ./genpass.module
Implements hook_form_alter().
genpass_generate in ./genpass.module
Generate a new password using the preferred password generation algorithm.

File

./genpass.module, line 338
Contains genpass.module.

Code

function genpass_algorithm_module() {
  $modules = genpass_algorithm_modules();
  $module = \Drupal::config('genpass.settings')
    ->get('genpass_algorithm');
  if (in_array($module, array_keys($modules))) {
    return $module;
  }
  else {
    return 'genpass';
  }
}