Author: bdaw
Date: 2011-08-16 06:05:35 -0400 (Tue, 16 Aug 2011)
New Revision: 7150
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java
Log:
GTNPORTAL-2026 CustomMembershipLoginModule should end lifecycle in case of an error
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java 2011-08-16
09:58:06 UTC (rev 7149)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java 2011-08-16
10:05:35 UTC (rev 7150)
@@ -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