AyKay
AyKay

Reputation: 1

Liferay unable to auto assign users to organisations? Then how?

Working with Liferay. (Actually Liferay working "against" me.)

I have a French, an English and a German Community, which are "locations" of an overall "regular organisation".

When a new user opts for a French branch of my site and signs up, how can he/she automatically get assigned to the French organization?

EDIT: In other words, How to automatically assign a newly registered user to an organisation (depending on from what page he/she signed up)?

Sarcastic side node: Do I really need to e-mail all new users to ask what language branch he/she was registering from in order to manually assign that person to the appropriate organisation?

Upvotes: 0

Views: 580

Answers (1)

Roberto Paolillo
Roberto Paolillo

Reputation: 121

Your question it's more functional than technical, so I'll try to give you a high-level description of the solution:

you can use a model listener (onAfterCreate method) on User object to add the desired organization programmatically through UserLocalService.addOrganizationUsers(). The organization could be chosen depending on a custom field (expando) defined on the User object and shown on registration page.

Otherwise, you could override com.liferay.portlet.login.action.CreateAccountAction in struts /login/create_account action and implement in your class a custom logic that adds the user to the organization depending on page groupId (got by request).

Upvotes: 1

Related Questions