public static class AccountSettingsActionListener extends EventListener<UIPortal> {
public void execute(Event<UIPortal> event) throws Exception {
UIPortal uiPortal = event.getSource();
UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
// Modified by nguyenanhkien2a@gmail.com
// We should check account for existing
String username = Util.getPortalRequestContext().getRemoteUser();
OrganizationService service = uiPortal.getApplicationComponent(OrganizationService.class);
User useraccount = service.getUserHandler().findUserByName(username);
if (useraccount != null) {
UIAccountSetting uiAccountForm = uiMaskWS.createUIComponent(UIAccountSetting.class, null, null);
uiMaskWS.setUIComponent(uiAccountForm);
uiMaskWS.setShow(true);
event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWS);
} else {
// Show message detail to user and then logout if user press ok button
JavascriptManager jsManager = Util.getPortalRequestContext().getJavascriptManager();
jsManager.require("SHARED/base").addScripts(