问题
I have deleted users from Liferay UI. Some time its asking to deactivate and then delete. some time only deactivate. And users are not going from db always. So, recreation of same user is not possible as it is throwing errors like "email address already exist or username alreasdy exist".
Why user is not getting deleted from DB after deletion from UI?
I am using liferay-portal-6.1.1-ce-ga2.
How to solve this issue?
回答1:
Deactivate
and Delete
are two different functionalities.
When you Deactivate
the user remains in the database and only the status
is changed to deactivate. This is known as a soft-delete or logical-delete, i.e. the User deactivated will not be able to login, nor will he appear in any of the searches etc. But the advantage is that you can bring the User back to life by just Activate
-ing the User. So this does not require you to re-create the User and also helps in keeping history or actions on the User.
If you want to delete the User from database, go to Control Panel → Users & Organizations → click on Search All Users → Search for the user either by Advanced or Basic Search → select the User(s) → Click Deactivate.
After this, do an Advanced Search → Select the status as Inactive → You will find all the de-activated users → select them and click Delete.
Hope this helps.
Edit
(thanks to @hudolejev for pointing this out in the comments below)
Please also note that the following property is set to true
to delete users in portal-ext.properties
, by default it is true
:
#
# Set this to false if users cannot be deleted.
#
users.delete=true
回答2:
Manual delete:
If you want to delete from the DB directly make sure you remove all records related to the user on the next tables:
DELETE FROM Users_UserGroups WHERE userId = 'userid';
DELETE FROM Users_Roles WHERE userId = 'userid';
DELETE FROM Users_Orgs WHERE userId = 'userid';
DELETE FROM Contact_ WHERE userId = 'userid';
DELETE FROM Group_ WHERE classPK = 'userid';
DELETE FROM User_ WHERE userId = 'userid';
回答3:
When you just dectivate the User it still exists in the Liferay DB,So after each deactivation go and try to find the deactivated user and then delete it.
If you dont find user after deactivation, try to go to the Server administration and Reindex all search indexes. and then try again.
Regards Manish
来源:https://stackoverflow.com/questions/19022517/users-are-not-getting-deleted-from-liferay-db