Examples of MemberVO


Examples of net.naijatek.myalumni.modules.common.domain.MemberVO

                                  ActionForm form,
                                  HttpServletRequest request,
                                  HttpServletResponse response )
      throws Exception {

     MemberVO token = getCurrentLoggedInUser(request);
       
    // check to see if the user logged on is a member
    if (!memberSecurityCheck(request,token)){
      return mapping.findForward(BaseConstants.FWD_LOGIN);
    }   

    PrivateMessageForm pmForm = (PrivateMessageForm) form;
    String memberId = token.getMemberId();
    String mailId =  pmForm.getMessageId();
    PrivateMessageVO pmVO = pmService.readOneMailByMemberId(memberId, mailId, getLastModifiedBy(request));
  
   
    if (pmVO != null){
View Full Code Here

Examples of net.naijatek.myalumni.modules.common.domain.MemberVO

                                  ActionForm form,
                                  HttpServletRequest request,
                                  HttpServletResponse response )
      throws Exception {

      MemberVO token = getCurrentLoggedInUser(request);

      // check to see if the user logged on is a member
      if (!memberSecurityCheck(request, token)){
        return mapping.findForward(BaseConstants.FWD_LOGIN);
      }
 
 
      if (isCancelled(request)){
         return mapping.findForward(BaseConstants.FWD_CANCEL);
      }
 
      PrivateMessageForm pmForm = (PrivateMessageForm) form;
      PrivateMessageVO pmVO = new PrivateMessageVO();
      PrivateMessageVO pmVOCopy = new PrivateMessageVO();
      BeanUtils.copyProperties(pmVO, pmForm);
      BeanUtils.copyProperties(pmVOCopy, pmForm);
 
      String toMemberEmail = memService.getMemberEmailByMemberId(pmVO.getMessageToUserId());
      SystemConfigVO sysConfigVO = sysConfigSerivce.getSystemConfig();
         
 
      if (pmVO.getType().equals("contact")) {
        if (!memService.isAccountActivatedByMemberId(pmVO.getMessageToUserId())) {
            ActionMessages errors = new ActionMessages();
            errors.add(BaseConstants.FATAL_KEY, new ActionMessage("message.mail.unactivatedmember"));
            saveMessages(request, errors);
            return mapping.getInputForward();
        }
        else {
          int quota = pmService.getQuotaRatioByMemberId(pmVO.getMessageToUserId());
          if (quota < SystemConfigConstants.MAIL_QUOTA ){
            pmVO.setMessageId(null);
            pmVOCopy.setMessageId(null);
            pmService.contactMail(pmVO, getLastModifiedBy(request), getCurrentIPAddress(request));
            SendMailUtil.memberNewMessageNotification(pmVO, sysConfigVO, toMemberEmail);
            //copy to sent
            if (pmForm.getCopyMe().equalsIgnoreCase(BaseConstants.BOOLEAN_YES)){
                pmService.copyMeOnContactMail(pmVOCopy, getLastModifiedBy(request),getCurrentIPAddress(request));
            }
          }
          else{
            ActionMessages errors = new ActionMessages();
            errors.add(BaseConstants.WARN_KEY, new ActionMessage("error.mailboxfull"));
            saveMessages(request, errors);
          }
        }
      }
      else if (pmVO.getType().equals("reply")) {
        pmVO.setMessageFromUserId(token.getMemberId());
        int quota = pmService.getQuotaRatioByMemberId(pmVO.getMessageToUserId());
        if (quota < SystemConfigConstants.MAIL_QUOTA ){
        pmVO.setMessageId(null); // setting to null becasue its a considered a new
          pmService.replyMail(pmVO, getLastModifiedBy(request),getCurrentIPAddress(request));
          SendMailUtil.memberNewMessageNotification(pmVO, sysConfigVO, toMemberEmail);
          //copy to sent
          if (pmForm.getCopyMe().equalsIgnoreCase(BaseConstants.BOOLEAN_YES)){
            pmService.copyMeOnReplyMail(pmVOCopy, getLastModifiedBy(request),getCurrentIPAddress(request));
          }
        }
        else{
        // TODO: Maybe save the message as a draft to be sent later
          ActionMessages errors = new ActionMessages();
          errors.add(BaseConstants.WARN_KEY, new ActionMessage("error.mailboxfull"));
          saveMessages(request, errors);
        }
      }
      else {
        ActionMessages errors = new ActionMessages();
        errors.add(BaseConstants.FATAL_KEY, new ActionMessage("errors.technical.difficulty"));
        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.modules.common.domain.MemberVO

                                  ActionForm form,
                                  HttpServletRequest request,
                                  HttpServletResponse response )
      throws Exception {

    MemberVO token = new MemberVO();

    PrivateMessageForm pmForm = (PrivateMessageForm)form;
    PrivateMessageVO pmVO = new PrivateMessageVO();

    BeanUtils.copyProperties(pmVO, pmForm);
  
   
    if(pmVO.getType().equals("contact")){
      if (pmVO.getMessageFromUserId().equalsIgnoreCase(BaseConstants.GUEST_USERNAME_ID)){
        pmService.contactAdminMail(pmVO, BaseConstants.GUEST_USERNAME_ID, getCurrentIPAddress(request));
      }
      else{
        pmService.contactAdminMail(pmVO, getLastModifiedBy(request), getCurrentIPAddress(request));
      }
    }
    else if (pmVO.getType().equals("reply")){
      if (pmVO.getMessageFromUserId().equalsIgnoreCase(BaseConstants.GUEST_USERNAME_ID)){
             pmVO.setMessageFromUserId(BaseConstants.GUEST_USERNAME_ID);
             pmService.replyMail(pmVO, BaseConstants.GUEST_USERNAME_ID, getCurrentIPAddress(request));
      }
      else{
             pmVO.setMessageFromUserId(token.getMemberId());
             pmService.replyMail(pmVO, getLastModifiedBy(request), getCurrentIPAddress(request));
      }     

    }
    else{
View Full Code Here

Examples of net.naijatek.myalumni.modules.common.domain.MemberVO

      * @param username username
      * @param password password
      */    
    public MemberVO login(String username, String password, String lastIPAddress) throws UserAccountException{
       
      MemberVO token = userAccountDao.getUserAccountByUserName(username)
         
        // Check if user account exists
        if (token == null){
            throw new UserAccountException(NotLoginException.WRONG_USERNAME);
             
        } else {
            // encrypt the password and compare to what the user had.
            String encPasswd = Encoder.getMD5_Base64(password);     
            // If the user passwords match, then check the account status.
            if (token.getMemberStatus().equalsIgnoreCase(BaseConstants.ACCOUNT_LOCKED)){
                throw new UserAccountException(NotLoginException.ACCOUNT_LOCKED);
            }
           
            if (token.getMemberStatus().equalsIgnoreCase(BaseConstants.ACCOUNT_DEACTIVATED)){
                throw new UserAccountException(NotLoginException.ACCOUNT_DEACTIVATED);
            }

            if (token.getMemberStatus().equalsIgnoreCase(BaseConstants.ACCOUNT_DELETED)){
                throw new UserAccountException(NotLoginException.ACCOUNT_DELETED);
            }
           
            if (token.getMemberStatus().equalsIgnoreCase(BaseConstants.ACCOUNT_UNAPPROVED)){
                throw new UserAccountException(NotLoginException.ACCOUNT_UNAPPROVED);
            }
           
            if (!encPasswd.equals(token.getMemberPassword())) {
                throw new UserAccountException(NotLoginException.WRONG_PASSWORD);
            }
           
       
        }
       
        Date lastLogonDate = new Date();
        userAccountDao.updateLastLogonDate(token.getMemberId(), lastLogonDate, lastIPAddress);
        token.setLastIPAddress(lastIPAddress)
        return token;        
    }
View Full Code Here

Examples of net.naijatek.myalumni.modules.common.domain.MemberVO

    * @throws <b>UserAccountException</b> if the user cannot be notified.
    */
    public void notifyPassword(String userName, HttpServletRequest request) throws UserAccountException {
                              
        // Lookup the user record, and check if user account exists. 
      MemberVO auth = userAccountDao.getUserAccountByUserName(userName);    
        if (auth == null) {
            throw new UserAccountException(NotLoginException.USER_NOT_FOUND);
        }
       
        // Locked
        if (auth.getMemberStatus().equals(BaseConstants.ACCOUNT_LOCKED)){
          throw new UserAccountException(NotLoginException.ACCOUNT_LOCKED);
        }
       
        // deactivated
        if (auth.getMemberStatus().equals(BaseConstants.ACCOUNT_DEACTIVATED)){
          throw new UserAccountException(NotLoginException.ACCOUNT_DEACTIVATED);
        }
       
        //unapproved
        if (auth.getMemberStatus().equals(BaseConstants.ACCOUNT_UNAPPROVED)){
          throw new UserAccountException(NotLoginException.ACCOUNT_UNAPPROVED);
        }
       
       
        SystemConfigVO sysConfigVO = sysConfigDao.getSystemConfig();
        try {
            // For security reasons, we generate a new random password for the user.
            // User should be forced to change this on next logon.
            String newPasswd =  PasswordGenerator.createPassword(8);
           
            // then use an email template to send the notification.       
             SendMailUtil.sendPasswordReminderMail(auth.getEmail(), auth.getFullName(), newPasswd, sysConfigVO);
           
            // update the system with the new user password(encrypted),
            // and insert a trail for that.
            userAccountDao.resetUserPassword(userName, Encoder.getMD5_Base64(newPasswd));
        } catch (Exception ex) {           
View Full Code Here

Examples of net.naijatek.myalumni.modules.common.domain.MemberVO

     * @throws <b>UserAccountException</b> if the user cannot be notified.
     */
     public void notifyUserName(String email, HttpServletRequest request) throws UserAccountException {
                               
         // Lookup the user record, and check if user account exists. 
       MemberVO auth = userAccountDao.getUserAccountByEmail(email)
      
         if (auth == null) {
             throw new UserAccountException(NotLoginException.USER_NOT_FOUND);
         }
        
         // Locked
         if (auth.getMemberStatus().equals(BaseConstants.ACCOUNT_LOCKED)){
           throw new UserAccountException(NotLoginException.ACCOUNT_LOCKED);
         }
        
         // deactivated
         if (auth.getMemberStatus().equals(BaseConstants.ACCOUNT_DEACTIVATED)){
           throw new UserAccountException(NotLoginException.ACCOUNT_DEACTIVATED);
         }
        
         //unapproved
         if (auth.getMemberStatus().equals(BaseConstants.ACCOUNT_UNAPPROVED)){
           throw new UserAccountException(NotLoginException.ACCOUNT_UNAPPROVED);
         }
        
        
         SystemConfigVO sysConfigVO = sysConfigDao.getSystemConfig();
         try {
          
             // then use an email template to send the notification.       
              SendMailUtil.sendUserNameReminderMail(auth.getEmail(), auth.getFullName(), auth.getMemberUserName(), sysConfigVO);
            
         } catch (Exception ex) {           
             throw new UserAccountException(ex.getMessage());
         }                
     }
View Full Code Here

Examples of net.naijatek.myalumni.modules.common.domain.MemberVO

    public void changePassword(String userName,
                               String oldPassword,
                               String newPassword) throws UserAccountException {
       
        // Lookup the user record, and check if user account exists. 
      MemberVO auth = userAccountDao.getUserAccountByUserName(userName);    
        if (auth == null) {
            throw new UserAccountException(NotLoginException.WRONG_USERNAME);
        }
       
        // encrypt the password and compare to what the user had.
        String encPasswd = Encoder.getMD5_Base64(oldPassword);
        if (!encPasswd.equals(auth.getMemberPassword())) {
            throw new UserAccountException(NotLoginException.WRONG_PASSWORD);
        }
       
        if (oldPassword.equals(newPassword)){
          throw new UserAccountException(NotLoginException.SAME_PASSWORD);
View Full Code Here

Examples of net.naijatek.myalumni.modules.common.domain.MemberVO

        userAccountDao.changeUserPassword(userName, Encoder.getMD5_Base64(newPassword));                 
    }   

    public void updateExpiredPassword(String userName, String newPassword, String tempPassword) throws UserAccountException {
        // Lookup the user record, and check if user account exists. 
      MemberVO auth = userAccountDao.getUserAccountByUserName(userName);    
        if (auth == null) {
            throw new UserAccountException(NotLoginException.WRONG_USERNAME);
        }
       
        // encrypt the password and compare to what the user had.
        String encPasswd = auth.getMemberPassword();
        if (!encPasswd.equals(Encoder.getMD5_Base64(tempPassword))) {
            throw new UserAccountException(NotLoginException.WRONG_PASSWORD);
        }
       
        if (newPassword.equals(tempPassword)){
View Full Code Here

Examples of net.naijatek.myalumni.modules.common.domain.MemberVO

      user.setCreationDate(new Date());
      add(user);
    }

    public void updateUser(MemberVO user) {
      MemberVO _user = (MemberVO) get(MemberVO.class, user.getMemberId());
      _user.updateUser(user);
      update(_user);
    }
View Full Code Here

Examples of net.naijatek.myalumni.modules.common.domain.MemberVO

    }

    public void deleteUser(String memberId) throws MyAlumniException {
       
        try {
           MemberVO memberVO = getMember(memberId);
           hardDelete(memberVO);
        } catch (Exception e) {
            throw new MyAlumniException("Unable to delete user because " + e.getMessage());
        }
    }
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.