Skip to content

Commit

Permalink
save user object persistently first before adding an alias
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwechner committed Feb 1, 2012
1 parent fd67533 commit 829852f
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -268,7 +268,6 @@ private void registerUser(Document doc, String gender, String firstname, String
org.wyona.security.core.api.User user = getRealm().getIdentityManager().getUserManager().createUser("" + customerID, firstname + " " + lastname, email, password);
// TODO: user.setProperty("gender", gender);
user.setLanguage(getContentLanguage());
org.wyona.security.core.api.User alias = getRealm().getIdentityManager().getUserManager().createAlias(email, "" + customerID);
// TODO: Move adding to groups into separated method
String groupsCSV = getResourceConfigProperty("groups");
if (groupsCSV != null) {
Expand All @@ -287,6 +286,8 @@ private void registerUser(Document doc, String gender, String firstname, String
}
}
}
user.save(); // INFO: User needs to be saved persistently before adding an alias, because otherwise one can add an alias though, but the 'link' from the user to the alias will not be created!
org.wyona.security.core.api.User alias = getRealm().getIdentityManager().getUserManager().createAlias(email, "" + customerID);

Element ncE = (Element) rootElement.appendChild(doc.createElementNS(NAMESPACE, "new-customer-registered"));
ncE.setAttributeNS(NAMESPACE, "id", "" + customerID);
Expand Down

0 comments on commit 829852f

Please sign in to comment.