Fóruns

Início » Liferay Portal » English » 2. Using Liferay » General

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
Chort Tanner
Deactivate inactive users
12 de Abril de 2012 08:39
Resposta

Chort Tanner

Ranking: New Member

Mensagens: 6

Data de entrada: 12 de Abril de 2012

Mensagens 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!
Hitoshi Ozawa
RE: Deactivate inactive users
12 de Abril de 2012 16:38
Resposta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensagens: 7952

Data de entrada: 23 de Março de 2010

Mensagens 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
Amos Fong
RE: Deactivate inactive users
12 de Abril de 2012 19:56
Resposta

Amos Fong

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1844

Data de entrada: 7 de Outubro de 2008

Mensagens 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);
Hitoshi Ozawa
RE: Deactivate inactive users
12 de Abril de 2012 22:12
Resposta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensagens: 7952

Data de entrada: 23 de Março de 2010

Mensagens 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.