/**
   * Do modify the password
   *
   * @param user the DatabaseUser
   * @param strPassword the new password not encrypted
   * @param plugin the plugin
   */
  public void doModifyPassword(DatabaseUser user, String strPassword, Plugin plugin) {
    // Updates password
    if (StringUtils.isNotBlank(strPassword)) {
      // Encrypts password or not
      String strEncryptedPassword = strPassword;

      if (_userParamService.isPasswordEncrypted(plugin)) {
        String strAlgorithm = _userParamService.getEncryptionAlgorithm(plugin);
        strEncryptedPassword = CryptoService.encrypt(strPassword, strAlgorithm);
      }

      DatabaseUser userStored = DatabaseUserHome.findByPrimaryKey(user.getUserId(), plugin);

      if (userStored != null) {
        userStored.setPasswordMaxValidDate(
            SecurityUtils.getPasswordMaxValidDate(_userParamService, plugin));
        DatabaseUserHome.updatePassword(userStored, strEncryptedPassword, plugin);
      }
    }
  }