Examples of MyAlumniUserContainer


Examples of net.naijatek.myalumni.framework.struts.MyAlumniUserContainer

        if (folderType.equalsIgnoreCase(BaseConstants.FOLDER_INBOX) ||
            folderType.equalsIgnoreCase(BaseConstants.FOLDER_SENT) ||
            folderType.equalsIgnoreCase(BaseConstants.FOLDER_TRASH) ||
            folderType.equalsIgnoreCase(BaseConstants.FOLDER_STORAGE))
        {
          MyAlumniUserContainer container = (MyAlumniUserContainer)request.getSession().getAttribute(BaseConstants.USER_CONTAINER);
            PrivateMessageHelper pmHelper = pmService.getAdminMessageCenter(adminUserId, folderType, container );
            setSessionObject(request, BaseConstants.MESSAGE_CENTER , pmHelper);
        }
        else{
          ActionMessages errors = new ActionMessages();
View Full Code Here

Examples of net.naijatek.myalumni.framework.struts.MyAlumniUserContainer

        BeanUtils.copyProperties(pmForm, pmVO);
        pmForm.setMessageDate(DateFormatUtil.getDateYYYYMMMDDHHMMA(pmVO.getMessageDate()));
        pmForm.setFromMemberFirstName(pmVO.getMessageFromMember().getFirstName());
        pmForm.setFromMemberLastName(pmVO.getMessageFromMember().getLastName());
       
        MyAlumniUserContainer container = (MyAlumniUserContainer)request.getSession().getAttribute(BaseConstants.USER_CONTAINER);
        PrivateMessageHelper pmHelper = pmService.getAdminMessageCenter(BaseConstants.ADMIN_USERNAME_ID, BaseConstants.FOLDER_INBOX, container );
        setSessionObject(request, BaseConstants.MESSAGE_CENTER , pmHelper);

        return mapping.findForward(BaseConstants.FWD_SUCCESS);
    }
View Full Code Here

Examples of net.naijatek.myalumni.framework.struts.MyAlumniUserContainer

                 new ActionMessage("errors.technical.difficulty"));
      saveMessages(request, errors);
      return mapping.getInputForward();
    }

    MyAlumniUserContainer container = (MyAlumniUserContainer)request.getSession().getAttribute(BaseConstants.USER_CONTAINER);
    PrivateMessageHelper pmHelper = pmService.getAdminMessageCenter(BaseConstants.ADMIN_USERNAME_ID, BaseConstants.FOLDER_INBOX, container );
    setSessionObject(request, BaseConstants.MESSAGE_CENTER , pmHelper);

    return mapping.findForward(BaseConstants.FWD_SUCCESS);
View Full Code Here

Examples of net.naijatek.myalumni.framework.struts.MyAlumniUserContainer

      return mapping.findForward(BaseConstants.FWD_SUCCESS);
    }
   
   
    private void doMailDuties(final MemberVO token, final HttpServletRequest request){
      MyAlumniUserContainer container = (MyAlumniUserContainer)request.getSession().getAttribute(BaseConstants.USER_CONTAINER);
      PrivateMessageHelper pmHelper = pmService.getAdminMessageCenter(BaseConstants.ADMIN_USERNAME_ID, BaseConstants.FOLDER_INBOX, container );
      setSessionObject(request, BaseConstants.MESSAGE_CENTER , pmHelper);
    }
View Full Code Here

Examples of net.naijatek.myalumni.framework.struts.MyAlumniUserContainer

         return mapping.findForward(BaseConstants.FWD_SUCCESS);
    }


    private void doMailDuties(final MemberVO token, final HttpServletRequest request){
      MyAlumniUserContainer container = (MyAlumniUserContainer)request.getSession().getAttribute(BaseConstants.USER_CONTAINER);
        PrivateMessageHelper pmHelper = pmService.getMessageCenter(token.getMemberId(), BaseConstants.FOLDER_INBOX, container );
        setSessionObject(request, BaseConstants.MESSAGE_CENTER , pmHelper);
    }
View Full Code Here

Examples of net.naijatek.myalumni.framework.struts.MyAlumniUserContainer

      if (!memberSecurityCheck(request, token)) {
        return mapping.findForward(BaseConstants.FWD_LOGIN);
      }
 
     
      MyAlumniUserContainer container = (MyAlumniUserContainer)request.getSession().getAttribute(BaseConstants.USER_CONTAINER);
      PrivateMessageHelper pmHelper = pmService.getMessageCenter(token.getMemberId(), BaseConstants.FOLDER_INBOX, container );
      setSessionObject(request, BaseConstants.MESSAGE_CENTER , pmHelper);
      return mapping.findForward(BaseConstants.FWD_SUCCESS);
    }   
View Full Code Here

Examples of net.naijatek.myalumni.framework.struts.MyAlumniUserContainer

      if (folderName.equalsIgnoreCase(BaseConstants.FOLDER_INBOX) ||
          folderName.equalsIgnoreCase(BaseConstants.FOLDER_SENT) ||
          folderName.equalsIgnoreCase(BaseConstants.FOLDER_TRASH) ||
          folderName.equalsIgnoreCase(BaseConstants.FOLDER_STORAGE))
      {
        MyAlumniUserContainer container = (MyAlumniUserContainer)request.getSession().getAttribute(BaseConstants.USER_CONTAINER);
          PrivateMessageHelper pmHelper = pmService.getMessageCenter(token.getMemberId(), folderName, container );
          setSessionObject(request, BaseConstants.MESSAGE_CENTER , pmHelper);
      }
      else{
        ActionMessages errors = new ActionMessages();
View Full Code Here

Examples of net.naijatek.myalumni.framework.struts.MyAlumniUserContainer

        saveMessages(request, errors);
        return mapping.getInputForward();
      }
     

      MyAlumniUserContainer container = (MyAlumniUserContainer)request.getSession().getAttribute(BaseConstants.USER_CONTAINER);
      PrivateMessageHelper pmHelper = pmService.getMessageCenter(token.getMemberId(), BaseConstants.FOLDER_INBOX, container );
      setSessionObject(request, BaseConstants.MESSAGE_CENTER , pmHelper);
 
      return mapping.findForward(BaseConstants.FWD_SUCCESS);
    }   
View Full Code Here

Examples of net.naijatek.myalumni.framework.struts.MyAlumniUserContainer

          MemberVO token = null;
          LoginHistoryVO accessHistory = null;
         
          ServletContext sCtx = request.getSession().getServletContext();
          WebApplicationContext wCtx = WebApplicationContextUtils.getWebApplicationContext(sCtx);       
          MyAlumniUserContainer container = (MyAlumniUserContainer)wCtx.getBean("userContainer");    
 
 
          logger.info("Login attempt --> , [ " + username +   " ][ " + currentIP + "]");
 
 
          if (counter == null) {
              session.setAttribute("loginCounter", new Integer(loginCounter));
              session.setAttribute("loginUserCounter", username);
          } else {
              loginCounter = counter.intValue();
          }
 
          // login and store it in the session
          accessHistory = createAccessHistory(request, username)
         
         
          try {
                token = securityService.login(username, password, currentIP);
                token.setLoginSuccessfull(true);
                accessHistory.setLoginStatus(BaseConstants.LOGIN_PASS);
                accessHistory.setReasonCode(ReasonCodes.SUCCESS);
             
             
              // Prompt user to change password
              if (token.getPromptChange().equals(BaseConstants.BOOLEAN_YES)){
               
                loginForm.setMemberUserName(token.getMemberUserName());
                loginForm.setMemberPassword("");
                loginForm.setMemberTempPassword("");
                loginForm.setMemberPasswordConfirm("");               
                
                session.invalidate();
                    errors.add(BaseConstants.INFO_KEY, new ActionMessage("errors.login.resetpassword"));
                    saveMessages(request, errors);
                    accessHistory.setLoginStatus(BaseConstants.LOGIN_FAIL);
                    accessHistory.setReasonCode(ReasonCodes.CHANGE_PASSWORD);
                  securityService.addAccessTrail(accessHistory);
                    return mapping.findForward(BaseConstants.FWD_EXPIRED_PASSWORD);
              }
             
             
              // Cant find roles
              if (token.getIsAdmin() == null || (!token.getIsAdmin().equals(BaseConstants.BOOLEAN_NO) & !token.getIsAdmin().equals(BaseConstants.BOOLEAN_YES))){
                  errors.add(BaseConstants.ERROR_KEY, new ActionMessage("errors.login.role"));
                  saveMessages(request, errors);
                    accessHistory.setLoginStatus(BaseConstants.LOGIN_FAIL);
                    accessHistory.setReasonCode(ReasonCodes.NO_ROLES_FOUND);
                  securityService.addAccessTrail(accessHistory);
                  return mapping.getInputForward();
              }    
             
             
             
          } catch (UserAccountException e) {
            //token.setLoginSuccessfull(false);
              if (e.getExceptionReason() == NotLoginException.ACCOUNT_DEACTIVATED) {
                  session.invalidate();
                  errors.add(BaseConstants.WARN_KEY, new ActionMessage("errors.account.deactivated"));
                  saveMessages(request, errors);
                  logger.info("ACCOUNT DEACTIVATED : " + username);
                    accessHistory.setLoginStatus(BaseConstants.LOGIN_FAIL);
                    accessHistory.setReasonCode(ReasonCodes.ACCOUNT_DEACTIVATED);
                securityService.addAccessTrail(accessHistory);
                  return mapping.getInputForward();
              }  
              if (e.getExceptionReason() == NotLoginException.ACCOUNT_DELETED) {
                  session.invalidate();
                  errors.add(BaseConstants.WARN_KEY, new ActionMessage("errors.account.deleted"));
                  saveMessages(request, errors);
                    accessHistory.setLoginStatus(BaseConstants.LOGIN_FAIL);
                    accessHistory.setReasonCode(ReasonCodes.ACCOUNT_DELETED);
                securityService.addAccessTrail(accessHistory);
                  return mapping.getInputForward();
              }              
              if (e.getExceptionReason() == NotLoginException.ACCOUNT_LOCKED) {
                  session.invalidate();
                  errors.add(BaseConstants.WARN_KEY, new ActionMessage("errors.account.locked"));
                  saveMessages(request, errors);
                  logger.info("ACCOUNT LOCKED : " + username);
                    accessHistory.setLoginStatus(BaseConstants.LOGIN_FAIL);
                    accessHistory.setReasonCode(ReasonCodes.ACCOUNT_LOCKED);
                securityService.addAccessTrail(accessHistory);
                  return mapping.getInputForward();
              }
              else if (e.getExceptionReason() == NotLoginException.WRONG_PASSWORD) {
                  //session.invalidate();
                  errors.add(BaseConstants.WARN_KEY, new ActionMessage("errors.password.mismatch", currentIP));
                  saveMessages(request, errors);
                  logger.info("INVALID PASSWORD : " + username);
                    accessHistory.setLoginStatus(BaseConstants.LOGIN_FAIL);
                    accessHistory.setReasonCode(ReasonCodes.INVALID_CREDENTIAL);
                   
                  // increment failed login counter
                  // if the same user contineously try to login , counter increases
                  // if a diff user from the prev user, but same session, counter resets
                  if (username.equals(session.getAttribute("loginUserCounter"))) {
                      loginCounter++;
                  } else {
                      loginCounter = 0;
                      session.setAttribute("loginCounter", new Integer(loginCounter));
                  }
 
                  // Maximum number of time a user can try to login unsuccessfully
                  int userMaxLogin = Integer.parseInt(getSysProp().getValue("USER_MAX_LOGIN"));
                  if (loginCounter >= userMaxLogin) {
                      logger.warn(username + " : User has exceeded maximum number of login attempts");
                      logger.warn("User account has been disabled. Please contact System Administrator");
 
                      // deactivating user account
                      if (securityService.lockMemberAccount(username)) {
                          session.invalidate();
                          errors.add(BaseConstants.WARN_KEY, new ActionMessage("errors.account.locked"));
                          logger.info("ACCOUNT LOCKED :  IP: (" + currentIP + ") " + username);
                          accessHistory.setLoginStatus(BaseConstants.LOGIN_FAIL);
                          accessHistory.setReasonCode(ReasonCodes.ACCOUNT_LOCKED);
                      securityService.addAccessTrail(accessHistory);
                      return mapping.getInputForward();
                      }
                  } else {
                      session.setAttribute("loginCounter", new Integer(loginCounter));
                  }
                 
                securityService.addAccessTrail(accessHistory);
                return mapping.getInputForward();
              }
              else if (e.getExceptionReason() == NotLoginException.WRONG_USERNAME) {
                  logger.info("INVALID USERNAME: IP: (" + currentIP + ") " + username + " User login attempt has failed. Count = " + loginCounter);
                    accessHistory.setLoginStatus(BaseConstants.LOGIN_FAIL);
                    accessHistory.setReasonCode(ReasonCodes.ACCOUNT_INVALID);
                  errors.add(BaseConstants.WARN_KEY, new ActionMessage("errors.password.mismatch"));
                  saveMessages(request, errors);
                  logger.info("UNSUCCESSFULL FWD_LOGIN - Invalid login  IP: (" + currentIP + ") " + username);
                    accessHistory.setLoginStatus(BaseConstants.LOGIN_FAIL);
                    accessHistory.setReasonCode(ReasonCodes.INVALID_CREDENTIAL);
                securityService.addAccessTrail(accessHistory);
                return mapping.getInputForward();
              }
              else if (e.getExceptionReason() == NotLoginException.ACCOUNT_UNAPPROVED) {
                  errors.add(BaseConstants.WARN_KEY, new ActionMessage("errors.account.notapproved"));
                  saveMessages(request, errors);
                  logger.info("UNSUCCESSFULL FWD_LOGIN - Account not approved yet. :  IP: (" + currentIP + ") " + username);
                    accessHistory.setLoginStatus(BaseConstants.LOGIN_FAIL);
                    accessHistory.setReasonCode(ReasonCodes.ACCOUNT_UNAPPROVED);
                  securityService.addAccessTrail(accessHistory);
                return mapping.getInputForward();
              }
             
          }
         

         
          if (token.isLoginSuccessfull()) {
              //clear out any old session info
              session = request.getSession(false);
              if (session != null) {
                  session.invalidate();
              }
 
             
              // Create a new session for this user
              session = request.getSession(true)
             

              // place users container in session
              container.setToken(token);
              setSessionUserContainer(request, container);
             
               
              setupOtherTasks(request, container, token);
             
View Full Code Here

Examples of net.naijatek.myalumni.framework.struts.MyAlumniUserContainer

        f.delete();
       
      //
      // remove from session
      //
      MyAlumniUserContainer container = getUserContainer(request);
      container.setAvatar("");
     
    }
    catch(Exception e){
      errors.add(BaseConstants.FATAL_KEY, new ActionMessage("errors.technical.difficulty"));
      saveMessages(request, errors);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.