HashMap map = ConfigurationManager.getInstance().getCustomerList();
log.debug("Cust Name: " + customerName);
CustomerVO cvo = (CustomerVO) map.get(customerName);
log.debug("Cust VO: " + cvo);
UserBD userBD = (UserBD)BusinessDelegateFactory.getInstance().getDelegate("com.eteam.ems.auth.delegates.UserBD");
log.debug(cvo.getDatasourceName()+ cvo.getDatabaseType());
log.debug(userVO.getUserName()+ userVO.getPassword());
// Authenticate
userBD.authenticate(cvo.getDatasourceName(), cvo.getDatabaseType(), userVO.getUserName(), userVO.getPassword());
//Authentication succeeded
// Get user specific info from DB and save this in the user session
SessionUserVO userSess = userBD.findUserSessionInfo(cvo.getDatasourceName(), cvo.getDatabaseType(), userVO.getUserName());
userSess.setCustomer(cvo);
userSess.setDsName(cvo.getDatasourceName());
userSess.setDbType(cvo.getDatabaseType());
// get user privileges
UserPrivilegeList userPrivileges = userBD.findUserPrivileges(cvo.getDatasourceName(), cvo.getDatabaseType(), userVO.getUserName());
HttpSession session = request.getSession();
if(userSess.getProfileId() == null)
{
log.debug("Profile Id is null");
/* Get UserID */
String userID = userBD.findUserID(cvo.getDatasourceName(),cvo.getDatabaseType(),userVO.getUserName());
userSess.setUserId(userID);
userSess.setUserPrivilegeList(userPrivileges);
session.setAttribute(IConstants.SESSION_ATTR_USER_SESSION_INFO, userSess);
session.setAttribute(IConstants.SESSION_ATTR_HTTP_BINDING_LISTENER, new EEMSHTTPSessionBindingListener());
log.debug("USER SESSION INFO: " + userSess.toString());
log.debug("Setting User Login Id: " + userVO.getUserName());
userSess.setUserLoginId(userVO.getUserName());
//session.setAttribute("UserLoginID", userVO.getUserName());
////////////////////////////////////////////////////////////
//request.setAttribute("redURL",dynaForm.getString("redURL"));
if(dynaForm.getString("redURL").equals("/admin/list_customers.jsp"))
actionFrwd = mapping.findForward("profileRedURL");
////////////////////////////////////////////////////////////
else
actionFrwd = mapping.findForward("profileURL");
}
else
{
/* If autoProfileUpdateEnabled is on */
log.debug("Configuration : "+cvo.getConfigurationType());
log.debug("Found Profile Id");
userSess.setUserPrivilegeList(userPrivileges);
session.setAttribute(IConstants.SESSION_ATTR_USER_SESSION_INFO, userSess);
session.setAttribute(IConstants.SESSION_ATTR_HTTP_BINDING_LISTENER, new EEMSHTTPSessionBindingListener());
log.debug("USER SESSION INFO: " + userSess.toString());
/* Check if the forceprofile is enabled or not */
String profileEnabled = "";
profileEnabled = userBD.findProfileEnabled(cvo.getDatasourceName(), cvo.getDatabaseType());
//if(cvo.getAutoProfileUpdateEnabled()!= null && cvo.getAutoProfileUpdateEnabled().equals("Y")){
if(profileEnabled!= null && profileEnabled.equals(IConstants.FORCE_PROFILE_ENABLED))
{
////////////////////////////////////////////////////////////