Foros de discusión

(Solved) Export all users also non active ones in Liferay 6.x

thumbnail
Davide Rossi, modificado hace 12 años.

(Solved) Export all users also non active ones in Liferay 6.x

Junior Member Mensajes: 55 Fecha de incorporación: 3/07/10 Mensajes recientes
Hi to all,
We put up a school ex student site "Alumni site" that has a user base well over 8000 users most of these are deactivated until we receive a registration request and if present in the user base then they get activated.
We are trying to "Export All Users" but only the active users are exported to csv. Extending user search status to ANY STATUS does find all 8000 users but these are not exported.
Is there a way to solve this via hooks???
Thank you....

Edited:

Even though still not a java pro I solved this myself changing one line of code to just a few if, ifelse statements.

Changed line 143 in
/portal_impl/src/com/liferay/portlet/useradmin/action/ExportUsersAction.java


From:
searchTerms.setStatus(WorkflowConstants.STATUS_APPROVED);


To:
int userStatus = searchTerms.getStatus();
		
if (userStatus == WorkflowConstants.STATUS_ANY) {
    searchTerms.setStatus(WorkflowConstants.STATUS_ANY);
} 
else if (userStatus == WorkflowConstants.STATUS_INACTIVE) {
    searchTerms.setStatus(WorkflowConstants.STATUS_INACTIVE);
} 
else if (userStatus == WorkflowConstants.STATUS_APPROVED) {
    searchTerms.setStatus(WorkflowConstants.STATUS_APPROVED);
}


Now works perfectly selecting advanced search Satus: *Any Status, Active and Inactive*

*Any Status* will return a csv export with All users
*Active* will return a csv export with all Active users
*Inactive* will return a csv export with all Inactive users.

Hope someone will fix this in gits 6.1.x and 6.2.x

Cheers!

Reported as an issue 23/Apr/12 3:01 PM
PUBLIC - Liferay Portal Community Edition
LPS-26910