-
Task
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
-
-
Empty show more show less
-
Empty show more show less
Look at old Public User Configuration:
http://demoauthor45.magnolia-cms.com/.magnolia/pages/adminCentral.html
under Configuration:modules/public-user-registration/config
New Public User Configuration:
MGNLPUR-89allowed configuration for multiple sites (only one default site at screenshot, see attached screenshot PURconfiguration.png)
- UserProfile class is now configured under userProfileConfiguration/userProfileClass
- We can add autopopulatedProperties node with properties which will be automatically populated in case of custom UserProfile. Note that default properties (username, password, fullName, email) are always populated (by default).
How to create and use custom profile class:
- extend info.magnolia.module.publicuserregistration.UserProfile
- add some extra property, you have to add its setter and getter:
public class CustomUserProfile extends UserProfile { private String extraParameter = ""; public String getExtraParameter() { return extraParameter; } public void setExtraParameter(String extraParameter) { this.extraParameter = extraParameter; } }
- add YOUR_PROPERTY_NAME ("extraParameter") under Configuration:modules/public-user-registration/config/configurations/NAME_OF_YOUR_SITE/userProfileConfiguration/autopopulatedProperties (see attached screenshot PURconfiguration.png
)
How to test it:
- add new form field named YOUR_PROPERTY_NAME ("extraParameter") to http://localhost:8080/magnoliaAuthor/demo-project/members-area/registration.html
- go to http://localhost:8080/magnoliaPublic/demo-project/members-area/registration.html and registrer new user
- go to http://localhost:8080/magnoliaPublic/.magnolia/pages/adminCentral.html, export user and check that YOUR_PROPERTY_NAME ("extraParameter") is in XML export
In 4.5.9 and prior was not possible to use custom UserProfile class because of bug in PUR module, see MGNLPUR-93.
Acceptance criteria
- documents
-
MGNLPUR-93 UserProfile is instantiated directly, ignoring user configuration
-
- Closed
-
-
MGNLPUR-89 Allow configuration for multiple sites
-
- Closed
-