Revision 95:2f9fb3b2341f

View differences:

WebContent/WEB-INF/config/ss112_user/struts-config.xml
79 79
			<forward name="success" path=".ibss.retail.enquiry.details.edit" />
80 80
			<forward name="resetPass" path="/ss112/userResetPassScreen.do" />
81 81
			<forward name="deleteConfirm" path="/ss112/delUserConfirm.do" />
82
			<forward name="suspend" path=".ibss.retail.user.suspend.confirm" />
83
			<forward name="unlock" path="/ss112/userUnlock.do" />
84
			<forward name="activate" path="/ss112/userActivate.do" />
82 85
			<forward name="back" path=".ibss.retail.enquiry.main" />
83 86
			<forward name="failure" path=".ibss.retail.enquiry.details" />
84 87
		</action>
......
94 97
			type="com.ib.ibss.controller.actions.ss112_user.IBSSRetailUserSuspendResultAction"
95 98
			validate="false">
96 99
			<forward name="success" path=".ibss.retail.user.suspend.result" />
97
			<forward name="failure" path=".ibss.retail.user.enquiry.details" />
100
			<forward name="back" path=".ibss.retail.enquiry.details" />
101
			<forward name="failure" path=".ibss.retail.user.suspend.confirm" />
98 102
		</action>
99 103
		<action name="ibssUserForm" path="/ss112/userUnsuspend" scope="session"
100 104
			type="com.ib.ibss.controller.actions.ss112_user.IBSSRetailUserUnsuspendResultAction"
WebContent/WEB-INF/config/ss112_user/tiles-defs.xml
41 41
		extends=".ibss.content.template">
42 42
		<put name="body" value="/jsp/ss112_user/ibssRetailUserEditResult.jsp" />
43 43
	</definition>
44
	
44 45
	<!-- Reset user password -->
45 46
	<definition name=".ibss.retail.enquiry.reset.pass" extends=".ibss.content.template">
46 47
		<put name="body" value="/jsp/ss112_user/ibssRetailUserResetPass.jsp" />
......
49 50
		extends=".ibss.content.template">
50 51
		<put name="body" value="/jsp/ss112_user/ibssRetailUserResetPassResult.jsp" />
51 52
	</definition>
53
	
52 54
	<!-- Delete User -->
53 55
	<definition name=".ibss.retail.enquiry.delete.user.success"
54 56
		extends=".ibss.content.template">
......
58 60
		extends=".ibss.content.template">
59 61
		<put name="body" value="/jsp/ss112_user/ibssRetailUserDeleteConfirm.jsp" />
60 62
	</definition>
63
	
61 64
	<!-- Suspend User -->
65
	<definition name=".ibss.retail.user.suspend.confirm" extends=".ibss.content.template">
66
		<put name="body" value="/jsp/ss112_user/ibssRetailUserSuspendConfirm.jsp" />
67
	</definition>
62 68
	<definition name=".ibss.retail.user.suspend.result" extends=".ibss.content.template">
63 69
		<put name="body" value="/jsp/ss112_user/ibssRetailUserSuspendResult.jsp" />
64 70
	</definition>
......
66 72
		extends=".ibss.content.template">
67 73
		<put name="body" value="/jsp/ss112_user/ibssRetailUserUnsuspendResult.jsp" />
68 74
	</definition>
75
	
69 76
	<!-- Activate User -->
70 77
	<definition name=".ibss.retail.user.activate.confirm"
71 78
		extends=".ibss.content.template">
......
75 82
		extends=".ibss.content.template">
76 83
		<put name="body" value="/jsp/ss112_user/ibssRetailUserActivateResult.jsp" />
77 84
	</definition>
85
	
78 86
	<!-- Unlock User -->
79 87
	<definition name=".ibss.retail.user.unlock.confirm" extends=".ibss.content.template">
80 88
		<put name="body" value="/jsp/ss112_user/ibssRetailUserUnlockConfirm.jsp" />
......
82 90
	<definition name=".ibss.retail.user.unlock.result" extends=".ibss.content.template">
83 91
		<put name="body" value="/jsp/ss112_user/ibssRetailUserUnlockResult.jsp" />
84 92
	</definition>
93
	
85 94
	<!-- Enable Change Mobile No -->
86 95
	<definition name=".ibss.retail.user.enable.chg.mobile.no.confirm"
87 96
		extends=".ibss.content.template">
......
93 102
		<put name="body"
94 103
			value="/jsp/ss112_user/ibssRetailUserEnableChgMobileNoResult.jsp" />
95 104
	</definition>
105
	
96 106
	<!-- Disable Change Mobile No -->
97 107
	<definition name=".ibss.retail.user.disable.chg.mobile.no.confirm"
98 108
		extends=".ibss.content.template">
......
104 114
		<put name="body"
105 115
			value="/jsp/ss112_user/ibssRetailUserDisableChgMobileNoResult.jsp" />
106 116
	</definition>
117
	
107 118
</tiles-definitions>
WebContent/jsp/ss112_user/ibssRetailUserActivateConfirm.jsp
5 5
<bean:define id="detailBean" name="ibssUserForm" property="ibssUserDetailBean" />
6 6

  
7 7
<h3 class="title"><strong><c:out value="${sessionScope.displayDesc}"/> - Activate Confirmation</strong></h3>
8
<htmlEL:form action="/ss112/userActivateResult.do">
9 8
<table class="tabularForm" width="517" border="1">
10 9
  <tr>
11
    <td width="96">&nbsp;</td>
12
    <td width="264">&nbsp;</td>
13
    <td width="146">&nbsp;</td>
14
    <td width="86">&nbsp;</td>
10
    <td width="75">&nbsp;</td>
11
    <td class="success" width="140"><strong><bean:message key="user.desc.confirmation"/></strong></td>
12
    <td width="93">&nbsp;</td>
13
    <td width="47">&nbsp;</td>
15 14
  </tr>
16
    <tr>
17
		<td>&nbsp;</td>
18
		<td><label id='label1'><bean:message key="user.user"/> : 
19
			<strong><c:out value="${detailBean.map.userAlias}"/></strong>
20
			<bean:message key="user.will.be"/>
21
			</label><strong><bean:message key="user.activate.desc"/></strong>.</td>
22
		<td>&nbsp;</td>
23
	</tr>
24 15
  <tr>
25
    <td>&nbsp;</td>
26
    <td>&nbsp;</td>
27
    <td colspan="2">
16
    <td height="28">&nbsp;</td>
17
    <td colspan="2"><bean:message key="user.user"/>
18
    <strong><c:out value="${detailBean.map.userAlias}"/></strong>
19
    <bean:message key="general.status.activate.confirm"/>
20
    </td>
21
  </tr>
22
</table>
23
<htmlEL:form action="/ss112/userActivateResult.do">
24
 <div class="floatRight">
28 25
      	<htmlEL:cancel property="action"  styleClass="button" onclick="overlay();">
29 26
			<bean:message key="general.button.back"/>
30 27
		</htmlEL:cancel>
31 28
		<htmlEL:submit property="action"  styleClass="button" onclick="overlay();">
32 29
			<bean:message key="general.button.confirm"/>
33 30
		</htmlEL:submit>
34
    </td>
35
  </tr>
36
</table>
37
</htmlEL:form>
31
 </div>
32
</htmlEL:form>
WebContent/jsp/ss112_user/ibssRetailUserDetails.jsp
127 127
			onclick="overlay();">
128 128
			<bean:message key="general.button.edit" />
129 129
		</htmlEL:submit>
130
		
131
		<c:if test="${detailBean.map.userStatusKey eq 1}">
132
		<htmlEL:submit property="action" styleClass="button"
133
			onclick="overlay();">
134
			<bean:message key="general.button.unlock" />
135
		</htmlEL:submit>
136
		</c:if>
137
		
138
		<c:if test="${detailBean.map.userStatusKey eq 2}">
139
		<htmlEL:submit property="action" styleClass="button"
140
			onclick="overlay();">
141
			<bean:message key="general.button.activate" />
142
		</htmlEL:submit>
143
		</c:if>
144
		
145
		<c:if test="${detailBean.map.userStatusKey ne 2}">
146
		<htmlEL:submit property="action" styleClass="button"
147
			onclick="overlay();">
148
			<bean:message key="general.button.suspend" />
149
		</htmlEL:submit>
150
		</c:if>
151
		
130 152
		<htmlEL:submit property="action" styleClass="button"
131 153
			onclick="overlay();">
132 154
			<bean:message key="general.button.reset.password" />
WebContent/jsp/ss112_user/ibssRetailUserSuspendConfirm.jsp
1
<%@ taglib uri="/WEB-INF/tld/struts-html-el" prefix="htmlEL" %>
2
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html" %>
3
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean" %>
4
<%@ taglib uri="/WEB-INF/tld/struts-logic-el" prefix="logicEL" %>
5
<%@ taglib uri="/WEB-INF/tld/c" prefix="c" %>
6

  
7
<bean:define id="detailBean" name="ibssUserForm" property="ibssUserDetailBean" />
8

  
9
<h3 class="title"><strong><c:out value="${sessionScope.displayDesc}"/> - <bean:message key="navigation.details.displayDesc.suspend.confirm" /></strong></h3>
10

  
11
<htmlEL:form action="/ss112/userSuspend.do">
12
<table id="errorTable">
13
<tr>
14
	<td>
15
		<span id="serverSideError" class="error"><jsp:include flush="true" page="/jsp/errorHandler.jsp"></jsp:include></span>
16
	</td>
17
</tr>
18
</table>
19
<table class="stepTable">
20
	<tr>
21
		<td>&nbsp;</td>
22
		<td><div id="steps"><span><bean:message key="general.title.steps" arg0="1" arg1="2"/></span></div></td>
23
	</tr>
24
</table>
25
<table class="tabularForm" width="517" border="1">
26
  <tr>
27
    <td width="75">&nbsp;</td>
28
    <td class="success" width="140"><strong><bean:message key="user.desc.confirmation"/></strong></td>
29
    <td width="93">&nbsp;</td>
30
    <td width="47">&nbsp;</td>
31
  </tr>
32
  <tr>
33

  
34
    <td height="28">&nbsp;</td>
35
    <td colspan="2"><bean:message key="general.user"/> <strong><c:out value="${detailBean.map.userAlias}"/> </strong>
36
    <bean:message key="general.status.suspend.confirm"/>
37
    </td>
38
    <td>&nbsp;</td>
39
  </tr>
40
</table>
41
  <div class="floatRight">
42
  	<htmlEL:cancel property="action" styleClass="button" onclick="overlay();">
43
		<bean:message key="general.button.back"/>						
44
	</htmlEL:cancel>
45
	<htmlEL:submit property="action" styleClass="button" onclick="overlay();">
46
		<bean:message key="general.button.confirm"/>						
47
	</htmlEL:submit>
48
  </div>
49
  </htmlEL:form>
WebContent/jsp/ss112_user/ibssRetailUserSuspendResult.jsp
20 20
  </tr>
21 21
  <tr>
22 22
    <td height="28">&nbsp;</td>
23
    <td colspan="2"><bean:message key="user.user"/> <bean:message key="user.have.been.successfully"/> <strong><bean:message key="user.suspend.desc"/></strong></td>
23
    <td colspan="2"><bean:write name="ibssUserForm" property="jspTitle"/></strong></td>
24 24
    <td>&nbsp;</td>
25 25
  </tr>
26 26
  <tr>
WebContent/jsp/ss112_user/ibssRetailUserUnlockConfirm.jsp
5 5
<bean:define id="detailBean" name="ibssUserForm" property="ibssUserDetailBean" />
6 6

  
7 7
<h3 class="title"><strong><c:out value="${sessionScope.displayDesc}"/> - Unlock Confirmation</strong></h3>
8
<htmlEL:form action="/ss112/userUnlockResult.do">
9 8
<table class="tabularForm" width="517" border="1">
10 9
  <tr>
11
    <td width="96">&nbsp;</td>
12
    <td width="264">&nbsp;</td>
13
    <td width="146">&nbsp;</td>
14
    <td width="86">&nbsp;</td>
10
    <td width="75">&nbsp;</td>
11
    <td class="success" width="140"><strong><bean:message key="user.desc.confirmation"/></strong></td>
12
    <td width="93">&nbsp;</td>
13
    <td width="47">&nbsp;</td>
15 14
  </tr>
16
    <tr>
17
		<td>&nbsp;</td>
18
		<td><label id='label1'><bean:message key="user.user"/> : 
19
			<strong><c:out value="${detailBean.map.userAlias}"/></strong>
20
			<bean:message key="user.will.be"/>
21
			</label><strong><bean:message key="user.unlock.desc"/></strong>.</td>
22
		<td>&nbsp;</td>
23
	</tr>
24 15
  <tr>
25
    <td>&nbsp;</td>
26
    <td>&nbsp;</td>
27
    <td colspan="2">
16
    <td height="28">&nbsp;</td>
17
    <td colspan="2"><bean:message key="user.user"/>
18
    <strong><c:out value="${detailBean.map.userAlias}"/></strong>
19
    <bean:message key="general.status.edit.lock"/>
20
    </td>
21
  </tr>
22
</table>
23
<htmlEL:form action="/ss112/userUnlockResult.do">
24
 <div class="floatRight">
28 25
      	<htmlEL:cancel property="action"  styleClass="button" onclick="overlay();">
29 26
			<bean:message key="general.button.back"/>
30 27
		</htmlEL:cancel>
31 28
		<htmlEL:submit property="action"  styleClass="button" onclick="overlay();">
32 29
			<bean:message key="general.button.confirm"/>
33 30
		</htmlEL:submit>
34
    </td>
35
  </tr>
36
</table>
31
 </div>
37 32
</htmlEL:form>
resource/com/ib/ibss/resources/message/IBSSBusinessOptionsResources.properties
23 23
bib.user.pending.status.option.value=0;1
24 24
bib.user.pending.status.option.display=No;Yes
25 25

  
26
user.status.option.value=0;1;2;3;4
27
user.status.option.display=Active;Locked;Inactive;Disabled;New
26
#user.status.option.value=0;1;2;3;4
27
#user.status.option.display=Active;Locked;Inactive;Disabled;New
28

  
29
user.status.option.value=0;1;2;3;
30
user.status.option.display=Active;Locked;Suspended;Inactive
28 31

  
29 32
admin.user.status.option.value=0;1;2;5;7;8;9
30 33
admin.user.status.option.display=Normal;Locked;Unlocked;New;Dormant;Suspend;Activate
src/com/ib/ibss/common/constant/AdminPermissionModeType.java
130 130
				Long actionId = 1025L;
131 131
				return actionId;
132 132
			}
133
		},
134
		SUSPEND_RIB_USER
135
		{
136
			public Long getActionId ()
137
			{
138
				Long actionId = 1026L;
139
				return actionId;
140
			}
133 141
		};
134 142

  
135 143
		public abstract Long getActionId ();
src/com/ib/ibss/common/utils/ActionTag.java
372 372
	{
373 373
		return DELETE.equalsIgnoreCase (p_sActionTag);
374 374
	}
375
	
376
	/**
377
	 * Validate does the give action is suspend.
378
	 *
379
	 * @param p_sActionTag Action tag
380
	 * @return true if the given action is suspend.
381
	 */
382
	public static boolean isSuspend (final String p_sActionTag)
383
	{
384
		return SUSPEND.equalsIgnoreCase (p_sActionTag);
385
	}
375 386

  
376 387
	/**
377 388
	 * Validate does the give action is submit.
......
559 570
	{
560 571
		return LOCK.equalsIgnoreCase(p_sActionTag);
561 572
	}
573
	
574
	/**
575
	 * Validate does the give action is activate.
576
	 *
577
	 * @param p_sActionTag Action tag
578
	 * @return true if the given action is activate.
579
	 */
580
	public static boolean isActivate(final String p_sActionTag)
581
	{
582
		return ACTIVATE.equalsIgnoreCase(p_sActionTag);
583
	}
562 584

  
563 585
	/**
564 586
	 * Validate does the given action is search.
src/com/ib/ibss/controller/actions/ss112_user/IBSSRetailUserEnquiryEditAction.java
81 81
		{
82 82
			setForwardPage("deleteConfirm");
83 83
		}
84
		else if(ActionTag.isSuspend(action))
85
		{
86
			setForwardPage("suspend");
87
		}
88
		else if(ActionTag.isUnlock(action))
89
		{
90
			setForwardPage("unlock");
91
		}
92
		else if(ActionTag.isActivate(action))
93
		{
94
			setForwardPage("activate");
95
		}
84 96
		
85 97
		else
86 98
		{
src/com/ib/ibss/controller/actions/ss112_user/IBSSRetailUserSuspendResultAction.java
18 18
import org.apache.struts.action.ActionForward;
19 19
import org.apache.struts.action.ActionMapping;
20 20

  
21
import com.ib.ibss.common.constant.AdminPermissionModeType.RIBPermission;
21 22
import com.ib.ibss.common.constant.FunctionConstants.FunctionCodeEnum;
22 23
import com.ib.ibss.common.utils.IBSSNavigationUtil;
24
import com.ib.ibss.enterprise.services.AccessConstants;
25
import com.ib.ibss.enterprise.services.common.SessionUserPermissionVerificationService;
23 26
import com.ib.ibss.enterprise.services.ss112_user.IBSSRetailUserSuspendResultServices;
24 27
import com.ib.ibss.error.exception.IBSSGenericException;
25 28
import com.ib.ibss.struts.utils.IBSSControllerAction;
......
54 57
		noErrorHandling (p_oRequest, p_oMapping);
55 58
		IBSSDynaBean m_oIBDynaBean 	= IBSSDynaBeanManager.createIBSSDynaBean (p_oForm, p_oMapping);
56 59
		
57
		try
60
		String action 	= p_oRequest.getParameter(AccessConstants.ACTION);		
61
		
62
		if("back".equalsIgnoreCase(action))
58 63
		{
59
			checkToken (p_oRequest, p_oMapping, false);
60
			checkCredential (p_oRequest, FunctionCodeEnum.RIB_USER_ENQUIRY);
61
			
62
			IBSSSessionObjects m_oSessionObjects = new IBSSSessionObjects(p_oRequest);
63
			IBSSNavigationUtil m_oTree = new IBSSNavigationUtil(m_oSessionObjects);
64
			m_oTree.buildNavigation ();
65
			
66
			IBSSRetailUserSuspendResultServices m_oServices = new IBSSRetailUserSuspendResultServices(m_oSessionObjects);
67
			m_oServices.setIBSSDynaBean (m_oIBDynaBean);
68
			m_oServices.execute();
69
		}
70
		catch (IBSSGenericException e)
64
			setForwardPage("back");
65
		}	
66
		else
71 67
		{
72
			errorHandling(p_oRequest, p_oMapping, e);
68
			try
69
			{
70
				checkToken (p_oRequest, p_oMapping, false);
71
				checkCredential (p_oRequest, FunctionCodeEnum.RIB_USER_ENQUIRY);
72
				
73
				IBSSSessionObjects m_oSessionObjects = new IBSSSessionObjects(p_oRequest);
74
				IBSSNavigationUtil m_oTree = new IBSSNavigationUtil(m_oSessionObjects);
75
				m_oTree.buildNavigation ();
76
				
77
				//Check User Permission Access
78
				Long actionId = RIBPermission.SUSPEND_RIB_USER.getActionId();
79
				SessionUserPermissionVerificationService access = new SessionUserPermissionVerificationService(m_oSessionObjects);
80
				access.validateUser(actionId);
81
				
82
				IBSSRetailUserSuspendResultServices m_oServices = new IBSSRetailUserSuspendResultServices(m_oSessionObjects);
83
				m_oServices.setIBSSDynaBean (m_oIBDynaBean);
84
				m_oServices.execute();
85
			}
86
			catch (IBSSGenericException e)
87
			{
88
				errorHandling(p_oRequest, p_oMapping, e);
89
			}
73 90
		}
74 91
		return super.execute (p_oMapping, p_oForm, p_oRequest, p_oResponse);
75 92
	}
src/com/ib/ibss/enterprise/services/ss112_user/IBSSRetailUserActivateResultServices.java
10 10
 */
11 11
package com.ib.ibss.enterprise.services.ss112_user;
12 12

  
13
import java.math.BigDecimal;
14
import java.util.Date;
15

  
16
import net.penril.ib.content.hibernate.IbServiceInfo;
13
import my.com.upass.MinimalConstants;
14
import my.com.upass.UPassControllerV2;
17 15
import net.penril.ibss.audit.log.AuditLogConstants;
18 16
import net.penril.ibss.audit.log.USER_ACTIVITY_TYTPE;
19
import net.penril.ibss.core.hibernate.IbCustProfile;
20 17

  
21
import com.ib.common.utils.constant.ServiceInfo;
22
import com.ib.enterprise.services.IBUtils;
23
import com.ib.enterprise.services.common.IBSmsLogger;
24
import com.ib.ibss.common.constant.AdminPermissionModeType.RIBPermission;
18
import com.ib.ibss.common.constant.ExceptionErrors;
25 19
import com.ib.ibss.common.utils.IBSSLogger;
26 20
import com.ib.ibss.common.utils.ResourcesUtils;
27 21
import com.ib.ibss.enterprise.services.IBSSEnterpriseServicesWorkspace;
22
import com.ib.ibss.enterprise.services.StatusConstants;
28 23
import com.ib.ibss.enterprise.services.ss102_user_admin.constants.IBSSUserConstants;
24
import com.ib.ibss.error.exception.IBSSBusinessException;
29 25
import com.ib.ibss.error.exception.IBSSGenericException;
30 26
import com.ib.ibss.error.handler.IBSSErrorHandler;
31 27
import com.ib.ibss.struts.utils.IBSSDynaBean;
......
66 62
		
67 63
		Long m_oLogStatus = AuditLogConstants.UNSUCCESSFUL;
68 64
		String m_sUserAlias = null;	
69
		String m_sUserName = null;
70
		String m_TACphoneNum = null;
71 65
		String m_sLogReason="";
72 66
		try
73 67
		{	
74
		
75
			
76
			
77 68
			IBSSDynaBean m_oDetailBean = (IBSSDynaBean) getIBSSDynaBean().get(IBSSUserConstants.IBSS_USER_DETAIL);
78 69
			m_sUserAlias = (String) m_oDetailBean.get (IBSSUserConstants.USER_ALIAS);
79 70
			Long m_lUserID = (Long) m_oDetailBean.get (IBSSUserConstants.USER_ID);
80
			m_sUserName = (String) m_oDetailBean.get (IBSSUserConstants.USER_NAME);
81
			m_TACphoneNum = (String) m_oDetailBean.get (IBSSUserConstants.USER_TAC_PHONE);
82
			RetailUserSharedServices m_oSharedServices = new RetailUserSharedServices();
83 71
			
84
			//Determine maker checker
85
			Long actionId = RIBPermission.ACTIVATE_RIB_USER.getActionId();			
86
			boolean isMakerChecker = m_oSharedServices.determineMakerChecker (actionId, getAdminActionDAO(), getIBSSessionObjects());	
72
			UPassControllerV2 upass = new UPassControllerV2();
87 73
			
88
			Long m_lUserUpdaterID = getIBSSessionObjects ().getSessionUser ().getUserId ();				
89
			m_sLogReason = m_oSharedServices.activateUser (getUPassService (), getUserProfileDAO (), m_sUserAlias, m_lUserID, m_lUserUpdaterID);
90
			m_oLogStatus = AuditLogConstants.SUCCESSFUL;
74
			int rc = upass.UA_ActivateUser(getIBSSessionObjects().getSessionUserAlias(), getIBSSessionObjects().getSessionUserPassword(), m_sUserAlias);
75
			
76
			switch(rc)
77
			{
78
				case MinimalConstants.ERR_SUCCESS:
79
					m_sLogReason = "Unlock Successful: " + m_sUserAlias;
80
					m_oLogStatus = AuditLogConstants.SUCCESSFUL;
81
					break;
82
				case MinimalConstants.ERR_ALREADY_EXIST:
83
					m_sLogReason = AuditLogConstants.CREATE_ADMIN_R_ALREADY_EXIST + m_sUserAlias;
84
					throw IBSSErrorHandler.createBusinessException (IBSSBusinessException.LOGIN, StatusConstants.UPASS_ERR_USER_ALREADY_EXIST);
85
				case MinimalConstants.ERR_INVALID_INPUT:
86
					m_sLogReason = String.valueOf(rc) + ResourcesUtils.getApplicationResourceMessage("error.invalid.input");
87
					throw IBSSErrorHandler.createBusinessException (IBSSBusinessException.LOGIN, StatusConstants.UPASS_ERR_INVALID_INPUT);
88
				default:
89
					m_sLogReason = "Unhandled Response: " + m_sUserAlias + " " + rc;
90
					throw IBSSErrorHandler.createBusinessException (IBSSBusinessException.LOGIN, ExceptionErrors.ERR_SYSTEM_NOT_READY);
91
			}
91 92
			
92 93
			setBeanMessage (IBSSUserConstants.JSP_TITLE, 
93 94
					ResourcesUtils.getApplicationResourceMessage ("user.user") + ": " + m_sUserAlias + " " +
94
					ResourcesUtils.getApplicationResourceMessage ("user.has.been.successfully") + " " +
95
					ResourcesUtils.getApplicationResourceMessage ("user.activate.desc"));
95
					ResourcesUtils.getApplicationResourceMessage ("user.success.activated"));
96 96
			
97
			//added SMS notification
98
			//log to sms table
99
			IbServiceInfo serviceNote =getServiceNoteContentDAO().getServiceNote (ServiceInfo.ACC_ACTIVATION);
100
			serviceNote.getSmsServiceBit();
101
			serviceNote.getSmsCharges();
102
			serviceNote.getSmsNote5();
103

  
104
			
105
			IBSmsLogger.logSms(
106
					serviceNote.getSmsServiceBit(),
107
					new BigDecimal(serviceNote.getSmsCharges()),
108
					getIbSmsNotificationDAO(),
109
					getSmsTableDAO(),
110
					IBUtils.getTransactionId (this.getIbUserTransctionHistoryDAO ()),
111
					ResourcesUtils.getSuccessful(),
112
					new Date (),
113
					"Notification",
114
					serviceNote.getSmsNote5(),
115
					"",
116
					m_lUserID,
117
					m_sUserName,
118
					m_TACphoneNum);
119
	
120 97
			setBeanMessage (IBSSUserConstants.USER_ID, String.valueOf (m_lUserID));			
121 98
		}
122 99
		catch (Exception e)
......
128 105
			try
129 106
			{
130 107
				getAuditLogDAO ().logActivity (USER_ACTIVITY_TYTPE.ACTIVATE_RIB_USER.getID(), 
131
						USER_ACTIVITY_TYTPE.ACTIVATE_RIB_USER.getDescription() + " " + m_sUserAlias, 
108
						USER_ACTIVITY_TYTPE.ACTIVATE_RIB_USER.getDescription() + ": " + m_sUserAlias, 
132 109
						m_oLogStatus, 
133 110
						m_sLogReason, 
134 111
						getIBSSessionObjects ().getSessionUserAlias (), 
src/com/ib/ibss/enterprise/services/ss112_user/IBSSRetailUserEnquiryMainServices.java
156 156
				user.setUstate(Integer.valueOf(userStatus));
157 157
			}
158 158
			
159
//			System.out.println("userStatus = "+userStatus);
160
//			if(DataValidator.isEmptyString(userStatus))
161
//			{
162
//				user.setUstate(Integer.valueOf("-1"));
163
//			}
164
			
159 165
			if (DataValidator.isEmptyString(userApplication)){
160 166
				ibccUser.setMinUser(user);
161 167
				im2uUser.setMinUser(user);
......
196 202
				creationDateTo = m_oDateFormat.parse(m_sCreateTo);
197 203
			}
198 204
				
199
				
200 205
			@SuppressWarnings("unchecked")
201 206
			List<UserProfile> userList = upass.listProfilesByExamples(getIBSSessionObjects().getSessionUserAlias(), getIBSSessionObjects().getSessionUserPassword(), uList, creationDateFrom, creationDateTo, session);
202 207
			
src/com/ib/ibss/enterprise/services/ss112_user/IBSSRetailUserSuspendResultServices.java
11 11

  
12 12
package com.ib.ibss.enterprise.services.ss112_user;
13 13

  
14
import my.com.upass.MinimalConstants;
15
import my.com.upass.UPassControllerV2;
14 16
import net.penril.ibss.audit.log.AuditLogConstants;
15 17
import net.penril.ibss.audit.log.USER_ACTIVITY_TYTPE;
16
import net.penril.ibss.core.hibernate.IbCustProfile;
17 18

  
18
import com.ib.ibss.common.constant.AdminPermissionModeType.RIBPermission;
19
import com.ib.ibss.common.constant.ExceptionErrors;
19 20
import com.ib.ibss.common.utils.IBSSLogger;
20 21
import com.ib.ibss.common.utils.ResourcesUtils;
21 22
import com.ib.ibss.enterprise.services.IBSSEnterpriseServicesWorkspace;
23
import com.ib.ibss.enterprise.services.StatusConstants;
22 24
import com.ib.ibss.enterprise.services.ss102_user_admin.constants.IBSSUserConstants;
25
import com.ib.ibss.error.exception.IBSSBusinessException;
23 26
import com.ib.ibss.error.exception.IBSSGenericException;
24 27
import com.ib.ibss.error.handler.IBSSErrorHandler;
25 28
import com.ib.ibss.struts.utils.IBSSDynaBean;
......
58 61
	{
59 62
		IBSSLogger.debug (c_oClass, "Entering execute");
60 63
		
61
		IBSSDynaBean m_oDetailBean;
64
		IBSSDynaBean detailBean;
62 65

  
63
		Long m_oLogStatus = AuditLogConstants.UNSUCCESSFUL;
64
		String m_sUserAlias = null;
66
		Long logStatus = AuditLogConstants.UNSUCCESSFUL;
67
		String userAlias = null;
68
		String logReason = "";
65 69
		
66 70
		try
67 71
		{
68
			m_oDetailBean 		= (IBSSDynaBean) getIBSSDynaBean().get(IBSSUserConstants.IBSS_USER_DETAIL);
72
			detailBean = (IBSSDynaBean) getIBSSDynaBean().get(IBSSUserConstants.IBSS_USER_DETAIL);
69 73
			
70
			Long m_sUserID = (Long) m_oDetailBean.get (IBSSUserConstants.USER_ID);
71
			m_sUserAlias = (String) m_oDetailBean.get (IBSSUserConstants.USER_ALIAS);
74
			Long uerID = (Long) detailBean.get (IBSSUserConstants.USER_ID);
75
			userAlias  = (String) detailBean.get (IBSSUserConstants.USER_ALIAS);
76
			System.out.println("userAlias = "+userAlias);
77
			
78
			UPassControllerV2 upass = new UPassControllerV2();
72 79

  
73
			RetailUserSharedServices m_oSharedServices = new RetailUserSharedServices();
74
			//Determine maker checker
75
			Long actionId = RIBPermission.DISABLE_RIB_USER.getActionId();		
76
			boolean isMakerChecker = m_oSharedServices.determineMakerChecker (actionId, getAdminActionDAO(), getIBSSessionObjects());	
77

  
78
			getUserProfileDAO ().updateUserSuspendStatus (m_sUserID, getIBSSessionObjects ().getSessionUser ().getUserId ());
79
			setBeanMessage (IBSSUserConstants.USER_ID, String.valueOf (m_sUserID));
80
			int rc = upass.UA_LockUser(getIBSSessionObjects().getSessionUserAlias(), getIBSSessionObjects().getSessionUserPassword(), userAlias);
81
			
82
			switch(rc)
83
			{
84
				case MinimalConstants.ERR_SUCCESS:
85
					logReason = "Suspend Successful: " + userAlias;
86
					logStatus = AuditLogConstants.SUCCESSFUL;
87
					break;
88
				case MinimalConstants.ERR_ALREADY_EXIST:
89
					logReason = AuditLogConstants.CREATE_ADMIN_R_ALREADY_EXIST + userAlias;
90
					throw IBSSErrorHandler.createBusinessException (IBSSBusinessException.LOGIN, StatusConstants.UPASS_ERR_USER_ALREADY_EXIST);
91
				case MinimalConstants.ERR_INVALID_INPUT:
92
					logReason = String.valueOf(rc) + ResourcesUtils.getApplicationResourceMessage("error.invalid.input");
93
					throw IBSSErrorHandler.createBusinessException (IBSSBusinessException.LOGIN, StatusConstants.UPASS_ERR_INVALID_INPUT);
94
				default:
95
					logReason = "Unhandled Response: " + userAlias + " " + rc;
96
					throw IBSSErrorHandler.createBusinessException (IBSSBusinessException.LOGIN, ExceptionErrors.ERR_SYSTEM_NOT_READY);
97
			}
98
			
99
			setBeanMessage (IBSSUserConstants.USER_ID, String.valueOf (uerID));
80 100
		
81
			m_oLogStatus = AuditLogConstants.SUCCESSFUL;
82
			
83 101
			setBeanMessage (IBSSUserConstants.JSP_TITLE, 
84
					ResourcesUtils.getApplicationResourceMessage ("user.user") + ": " + m_sUserAlias + " " +
102
					ResourcesUtils.getApplicationResourceMessage ("user.user") + ": " + userAlias + " " +
85 103
					ResourcesUtils.getApplicationResourceMessage ("user.has.been.successfully") + " " +
86 104
					ResourcesUtils.getApplicationResourceMessage ("user.suspend.desc"));
87 105
		}
......
94 112
			try
95 113
			{
96 114
				getAuditLogDAO ().logActivity (USER_ACTIVITY_TYTPE.SUSPEND_RIB_USER.getID(), 
97
						USER_ACTIVITY_TYTPE.SUSPEND_RIB_USER.getDescription() + " " + m_sUserAlias, 
98
						m_oLogStatus, 
99
						"", 
115
						USER_ACTIVITY_TYTPE.SUSPEND_RIB_USER.getDescription() + ": " + userAlias, 
116
						logStatus, 
117
						logReason, 
100 118
						getIBSSessionObjects ().getSessionUserAlias (), 
101 119
						getIBSSessionObjects ().getSessionUser ().getRoleId (),
102 120
						getIBSSessionObjects ().getSessionUser ().getGroupId (),
src/com/ib/ibss/enterprise/services/ss112_user/IBSSRetailUserUnlockResultServices.java
10 10
 */
11 11
package com.ib.ibss.enterprise.services.ss112_user;
12 12

  
13
import java.math.BigDecimal;
14
import java.util.Date;
15

  
16
import net.penril.ib.content.hibernate.IbServiceInfo;
13
import my.com.upass.MinimalConstants;
14
import my.com.upass.UPassControllerV2;
17 15
import net.penril.ibss.audit.log.AuditLogConstants;
18 16
import net.penril.ibss.audit.log.USER_ACTIVITY_TYTPE;
19
import net.penril.ibss.core.hibernate.IbCustProfile;
20 17

  
21
import com.ib.common.utils.constant.ServiceInfo;
22
import com.ib.enterprise.services.IBUtils;
23
import com.ib.enterprise.services.common.IBSmsLogger;
24
import com.ib.ibss.common.constant.AdminPermissionModeType.RIBPermission;
18
import com.ib.ibss.common.constant.ExceptionErrors;
25 19
import com.ib.ibss.common.utils.IBSSLogger;
26 20
import com.ib.ibss.common.utils.ResourcesUtils;
27 21
import com.ib.ibss.enterprise.services.IBSSEnterpriseServicesWorkspace;
22
import com.ib.ibss.enterprise.services.StatusConstants;
28 23
import com.ib.ibss.enterprise.services.ss102_user_admin.constants.IBSSUserConstants;
24
import com.ib.ibss.error.exception.IBSSBusinessException;
29 25
import com.ib.ibss.error.exception.IBSSGenericException;
30 26
import com.ib.ibss.error.handler.IBSSErrorHandler;
31 27
import com.ib.ibss.struts.utils.IBSSDynaBean;
......
76 72
			long m_lUserStatus = (Long) m_oDetailBean.get (IBSSUserConstants.USER_STATE_KEY) ;
77 73
			m_sUserAlias = (String) m_oDetailBean.get (IBSSUserConstants.USER_ALIAS);
78 74
			Long m_lUserID = (Long) m_oDetailBean.get (IBSSUserConstants.USER_ID);
79
			String m_sUserName = (String) m_oDetailBean.get (IBSSUserConstants.USER_NAME);
80
			String m_TACphoneNum = (String) m_oDetailBean.get (IBSSUserConstants.USER_TAC_PHONE);
81
			RetailUserSharedServices m_oSharedServices = new RetailUserSharedServices();
75
//			String m_sUserName = (String) m_oDetailBean.get (IBSSUserConstants.USER_NAME);
76
//			String m_TACphoneNum = (String) m_oDetailBean.get (IBSSUserConstants.USER_TAC_PHONE);
82 77
			
83
			
84
			//Provide info based on lock type
85
			String m_sMkType="";
86
			String m_sMkDescResource="";
87 78
			String m_sJspTitleResource="";
88
			Long actionId = 0L;
89 79
			if(m_lUserStatus == IBSSUserConstants.USER_STATUS_LOCKED) //password lock
90 80
			{				
91 81
				m_sJspTitleResource ="user.unlock.desc";
92
				m_sMkDescResource = "user.mk.desc.unlock.rib.user";
93 82
				m_lAuditCategoryID = USER_ACTIVITY_TYTPE.UNLOCK_RIB_USER.getID();
94 83
				m_sLogDescription = USER_ACTIVITY_TYTPE.UNLOCK_RIB_USER.getDescription();
95
				actionId = RIBPermission.UNLOCK_RIB_USER.getActionId();
96 84
			}
97 85
			else if (m_lUserStatus == IBSSUserConstants.USER_STATUS_TAC_LOCKED)//TAC lock				
98 86
			{
99 87
				m_sJspTitleResource ="user.tac.unlock.desc";
100
				m_sMkDescResource = "user.mk.desc.unlock.tac.rib.user";
101 88
				m_lAuditCategoryID = USER_ACTIVITY_TYTPE.UNLOCK_TAC_RIB_USER.getID();
102 89
				m_sLogDescription = USER_ACTIVITY_TYTPE.UNLOCK_TAC_RIB_USER.getDescription();
103
				actionId = RIBPermission.UNLOCK_RIB_USER_TAC.getActionId();
104 90
			}
105 91
			
106
			Long m_lUserUpdaterID = getIBSSessionObjects ().getSessionUser ().getUserId ();				
107
			m_sLogReason= m_oSharedServices.unlockUser (
108
					getUPassService (), getUserProfileDAO (), 
109
					m_sUserAlias, m_lUserStatus, m_lUserID, m_lUserUpdaterID);				
110
			m_oLogStatus = AuditLogConstants.SUCCESSFUL;
92
			UPassControllerV2 upass = new UPassControllerV2();
93
			
94
			int rc = upass.UA_ActivateUser(getIBSSessionObjects().getSessionUserAlias(), getIBSSessionObjects().getSessionUserPassword(), m_sUserAlias);
95
			
96
			switch(rc)
97
			{
98
				case MinimalConstants.ERR_SUCCESS:
99
					m_sLogReason = "Unlock Successful: " + m_sUserAlias;
100
					m_oLogStatus = AuditLogConstants.SUCCESSFUL;
101
					break;
102
				case MinimalConstants.ERR_ALREADY_EXIST:
103
					m_sLogReason = AuditLogConstants.CREATE_ADMIN_R_ALREADY_EXIST + m_sUserAlias;
104
					throw IBSSErrorHandler.createBusinessException (IBSSBusinessException.LOGIN, StatusConstants.UPASS_ERR_USER_ALREADY_EXIST);
105
				case MinimalConstants.ERR_INVALID_INPUT:
106
					m_sLogReason = String.valueOf(rc) + ResourcesUtils.getApplicationResourceMessage("error.invalid.input");
107
					throw IBSSErrorHandler.createBusinessException (IBSSBusinessException.LOGIN, StatusConstants.UPASS_ERR_INVALID_INPUT);
108
				default:
109
					m_sLogReason = "Unhandled Response: " + m_sUserAlias + " " + rc;
110
					throw IBSSErrorHandler.createBusinessException (IBSSBusinessException.LOGIN, ExceptionErrors.ERR_SYSTEM_NOT_READY);
111
			}
111 112
			
112 113
			setBeanMessage (IBSSUserConstants.JSP_TITLE, 
113 114
					ResourcesUtils.getApplicationResourceMessage ("user.user") + ": " + m_sUserAlias + " " +
114 115
					ResourcesUtils.getApplicationResourceMessage ("user.has.been.successfully") + " " +
115 116
					ResourcesUtils.getApplicationResourceMessage (m_sJspTitleResource));
116 117
			
117

  
118
			//added SMS notification
119
			
120
			IbServiceInfo serviceNote =getServiceNoteContentDAO().getServiceNote (ServiceInfo.ACC_UNLOCK);
121
			serviceNote.getSmsServiceBit();
122
			serviceNote.getSmsCharges();
123
			serviceNote.getSmsNote5();
124
			System.out.println("sms bit="+serviceNote.getSmsServiceBit());
125
			System.out.println("sms charges="+serviceNote.getSmsCharges());
126
			System.out.println("sms message="+serviceNote.getSmsNote5());
127
			
128
			//log to sms table
129
			IBSmsLogger.logSms(
130
					serviceNote.getSmsServiceBit(),
131
					new BigDecimal(serviceNote.getSmsCharges()),
132
					getIbSmsNotificationDAO(),
133
					getSmsTableDAO(),
134
					IBUtils.getTransactionId (this.getIbUserTransctionHistoryDAO ()),
135
					ResourcesUtils.getSuccessful(),
136
					new Date (),
137
					"Notification",
138
					serviceNote.getSmsNote5(),
139
					"",
140
					m_lUserID,
141
					m_sUserName,
142
					m_TACphoneNum);
143
				
144 118
			setBeanMessage (IBSSUserConstants.USER_ID, String.valueOf (m_lUserID));			
145 119
		}
146 120
		catch (Exception e)
......
152 126
			try
153 127
			{			
154 128
				getAuditLogDAO ().logActivity (m_lAuditCategoryID, 
155
						m_sLogDescription + " " + m_sUserAlias, 
129
						m_sLogDescription + ": " + m_sUserAlias, 
156 130
						m_oLogStatus, 
157 131
						m_sLogReason, 
158 132
						getIBSSessionObjects ().getSessionUserAlias (), 
src/com/ib/ibss/enterprise/services/ss223_application/IBSSApplicationUserDeleteResultServices.java
74 74
			
75 75
			int rc = upass.deleteUserWithTheProfile(getIBSSessionObjects().getSessionUserAlias(), getIBSSessionObjects().getSessionUserPassword(), userAlias, appId, session);
76 76
			
77
			if(rc != MinimalConstants.ERR_SUCCESS)
77
			switch(rc)
78 78
			{
79
				switch(rc)
80
				{
81 79
				case MinimalConstants.ERR_SUCCESS:
82 80
					logReason = "Delete Successful: " + userAlias;
83 81
					logStatus = AuditLogConstants.SUCCESSFUL;
......
91 89
				default:
92 90
					logReason = "Unhandled Response: " + userAlias + " " + rc;
93 91
					throw IBSSErrorHandler.createBusinessException (IBSSBusinessException.LOGIN, ExceptionErrors.ERR_SYSTEM_NOT_READY);
94
				}
95 92
			}
96 93
			
97 94
			getIBSSDynaBean ().set (IBSSUserConstants.JSP_TITLE, 
src/com/ib/ibss/enterprise/services/ss223_application/IBSSApplicationUserMainServices.java
31 31
import com.ib.ibss.common.constant.IBSSCommonConstants;
32 32
import com.ib.ibss.common.utils.IBSSLogger;
33 33
import com.ib.ibss.common.utils.Pagination;
34
import com.ib.ibss.common.utils.ResourcesUtils;
35 34
import com.ib.ibss.enterprise.services.IBSSEnterpriseServicesWorkspace;
36 35
import com.ib.ibss.enterprise.services.common.SessionUserPermissionVerificationService;
37 36
import com.ib.ibss.enterprise.services.ss222_application.constants.IBSSApplicationUserConstants;

Also available in: Unified diff