Author: phuong_vu
Date: 2011-02-13 22:51:18 -0500 (Sun, 13 Feb 2011)
New Revision: 5871
Modified:
portal/branches/branch-GTNPORTAL-1790/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
Log:
GTNPORTAL-1757 NPE when click link to request a new password for the username in mail
after delete user
Modified:
portal/branches/branch-GTNPORTAL-1790/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1790/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2011-02-12
04:43:14 UTC (rev 5870)
+++
portal/branches/branch-GTNPORTAL-1790/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2011-02-14
03:51:18 UTC (rev 5871)
@@ -419,23 +419,29 @@
RemindPasswordTokenService tokenService =
uiPortal.getApplicationComponent(RemindPasswordTokenService.class);
String tokenId =
event.getRequestContext().getRequestParameter("tokenId");
+ WebuiRequestContext requestContext = event.getRequestContext();
GateInToken token = tokenService.getToken(tokenId);
if (token == null)
{
- WebuiRequestContext requestContext = event.getRequestContext();
requestContext.getUIApplication()
.addMessage(new
ApplicationMessage("UIForgetPassword.msg.expration", null));
requestContext.addUIComponentToUpdateByAjax(uiPortal.getParent());
return;
}
- UIPortalApplication uiApp =
uiPortal.getAncestorOfType(UIPortalApplication.class);
- UIMaskWorkspace uiMaskWS =
uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
-
OrganizationService orgSrc =
uiPortal.getApplicationComponent(OrganizationService.class);
// get user
User user =
orgSrc.getUserHandler().findUserByName(token.getPayload().getUsername());
+ if (user == null)
+ {
+ requestContext.getUIApplication()
+ .addMessage(new
ApplicationMessage("UIForgetPassword.msg.user-delete", null));
+ return;
+ }
+ UIPortalApplication uiApp =
uiPortal.getAncestorOfType(UIPortalApplication.class);
+ UIMaskWorkspace uiMaskWS =
uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
+
UIResetPassword uiReset = uiMaskWS.createUIComponent(UIResetPassword.class,
null, null);
uiReset.setUser(user);
uiReset.setTokenId(tokenId);
Show replies by date