views:

35

answers:

2

Hi

Is it possible to deactivate users by default in liferay when they sign up so that the administrator could approve/activate thier accounts later on.

Thanks in advance

A: 

You can do this with a ModelListener for the User class - e.g. when a user is created first, your Listener should immediately set it to 'deactivated'.

You do this easiest in a custom hook that you'd have to write (see the linked wiki article). Hooks are quite easy to create with Liferay's plugin-sdk.

Olaf
A: 

Inside your ModelListener hook do this...

UserLocalServiceUtil.updateActive(userId, false);

Its really easy to write Hooks checkout Liferay documentation.

Intesar Mohammed