Esempio n. 1
0
  @End
  public String register() {
    valid = true;
    validateUsername(getUsername());
    validateHumanField();

    if (!isValid()) {
      return null;
    }
    final String user = getUsername();
    final String pass = getPassword();
    final String email = getEmail();
    String key = registerServiceImpl.register(user, pass, getPerson().getName(), email);
    log.info("get register key:" + key);

    String message = emailServiceImpl.sendActivationEmail(user, email, key);
    facesMessages.addGlobal(message);

    return "/home.xhtml";
  }
Esempio n. 2
0
  @End
  public String register() {
    valid = true;
    validateUsername(getUsername());
    validatePasswords(getPassword(), getPasswordConfirm());
    validateTermsOfUse();

    if (!isValid()) {
      return null;
    }
    final String user = getUsername();
    final String pass = getPassword();
    final String email = getEmail();
    String key = registerServiceImpl.register(user, pass, getPerson().getName(), email);
    log.info("get register key:" + key);

    String message =
        emailServiceImpl.sendActivationEmail(
            EmailService.ACTIVATION_ACCOUNT_EMAIL_TEMPLATE, user, email, key);
    FacesMessages.instance().add(message);

    return "/home.xhtml";
  }
 public void mergeAccounts() {
   registerServiceImpl.mergeAccounts(authenticatedAccount, obsoleteAccount);
   obsoleteAccount = null; // reset the obsolete account
   facesMessages.addGlobal("Your accounts have been merged.");
 }