Fórum

Deactivate inactive users

Chort Tanner, modificado 12 Anos atrás.

Deactivate inactive users

New Member Postagens: 6 Data de Entrada: 12/04/12 Postagens Recentes
Hello everyone,

I have same problem with liferay 6.0.5
The Idea is to deactivate users who was not log in for more to a portal for more than one year.
I manage to update the field at the DB (by updating the "active_" to 0 (zero) in "user_" table) and user cannot log in any more, but he is is still appear at UI in the list of users as active one but with the feature activate.
First I thought this might be because of DB cache but it does looks like this, since the behavior is still the same even after restart of the server.

Any help is welcome!
thumbnail
Hitoshi Ozawa, modificado 12 Anos atrás.

RE: Deactivate inactive users

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
It's not the cache. Liferay by default keeps user information in Lucene search index. You'll need to go to control panel -> Server Administration -> Reindex all indexes to update your Lucene indexes. If you're not having any performance issues, it's possible to not use Lucene to store user information. Just set the following in portal-ext.properties.
#
# Set this to true to search users from the index. Set this to false to
# search users from the database. Note that setting this to false will
# disable the ability to search users based on Expando attributes.
#
users.search.with.index=false
thumbnail
Amos Fong, modificado 12 Anos atrás.

RE: Deactivate inactive users

Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens Recentes
Yea I think Hitoshi is right. You can avoid this by using the User service calls instead of updating the DB directly:

UserLocalServiceUtil.updateStatus(userId, status);
thumbnail
Hitoshi Ozawa, modificado 12 Anos atrás.

RE: Deactivate inactive users

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
If you're going to write a portlet, might as well register a job in Liferay's cron so it'll automatically run each night to deactive the users.
I actually have a portlet that'll send email to users at night using Liferay's cron so it's definitely possible to create one.