Author: bdaw
Date: 2011-08-16 07:45:05 -0400 (Tue, 16 Aug 2011)
New Revision: 7153
Modified:
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java
Log:
JBEPP-1032 CustomMembershipLoginModule should end lifecycle in case of an error
Modified:
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java 2011-08-16
10:52:15 UTC (rev 7152)
+++
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java 2011-08-16
11:45:05 UTC (rev 7153)
@@ -146,15 +146,14 @@
*/
private void addUserToPlatformUsers(String userId) throws Exception
{
+ OrganizationService orgService =
(OrganizationService)getContainer().getComponentInstanceOfType(OrganizationService.class);
try
{
- OrganizationService orgService =
(OrganizationService)getContainer().getComponentInstanceOfType(OrganizationService.class);
begin(orgService);
User user = orgService.getUserHandler().findUserByName(userId);
MembershipType memberType =
orgService.getMembershipTypeHandler().findMembershipType(membershipType);
Group platformUsersGroup = orgService.getGroupHandler().findGroupById(groupId);
orgService.getMembershipHandler().linkMembership(user, platformUsersGroup,
memberType, true);
- end(orgService);
}
catch (Exception e)
{
@@ -162,6 +161,10 @@
// don't rethrow login exception in case of failure.
// throw e;
}
+ finally
+ {
+ end(orgService);
+ }
}
private void begin(OrganizationService orgService) throws Exception
{
Show replies by date