Package org.geogrid.aist.tsukubagama.services.request

Examples of org.geogrid.aist.tsukubagama.services.request.AccountRequest


        throws PortletException {
        log.debug("Entered cancelRenewRequest");
        ActionResponse res = event.getActionResponse();

        String oid = event.getAction().getParameter("oid");
        AccountRequest accountRequest =
            accountService.getAccountRequestByOid(oid);
        if (accountRequest == null) {
            log.error("AccountRequest was already deleted.");
            res.setRenderParameter("message", "Account was already deleted.");
            return ;
View Full Code Here


        throws PortletException {
        log.debug("Entered cancelResetRequest");
        ActionResponse res = event.getActionResponse();

        String oid = event.getAction().getParameter("oid");
        AccountRequest accountRequest =
            accountService.getAccountRequestByOid(oid);
        if (accountRequest == null) {
            log.error("AccountRequest was already deleted.");
            res.setRenderParameter("message", "Account was already deleted.");
            return ;
View Full Code Here

    public void sendRenewalNoticeToAdministrator(List requests)
        throws Exception
    {
        List accountRequests = new ArrayList();
        for (Iterator itr = requests.iterator(); itr.hasNext(); ) {
            AccountRequest item = (AccountRequest)itr.next();
            accountRequests.add( new AccountRequestHelper(item) );
        }
        VelocityContext cx = new VelocityContext();
        cx.put("accountRequests", accountRequests);
        String message = mergeTemplate(ACCOUNT_RENEWAL_NOTICE_ADMIN, cx);
View Full Code Here

        if (isBlank(username)) {
            response.setRenderParameter("error_message", "username is empty");
            setNextState(request, STEP1_JSP);
            return;
        }
        AccountRequest accountRequest =
            accountService.getAccountRequestByUsername(username);
        if (accountRequest == null) {
            response.setRenderParameter("error_message", "username '" + username + "' does not exists.");
            setNextState(request, STEP1_JSP);
            return;
        } else if (!accountRequest.isActivated()) {
            response.setRenderParameter("error_message", "Cannot reset account");
            setNextState(request, STEP1_JSP);
            return;
        }
View Full Code Here

        }
        return null;
    }

    private String setStatusReset(String username, String pinNumber) {
        AccountRequest accountRequest =
            accountService.getAccountRequestByUsername(username);
        if (accountRequest == null) {
            log.error("Invalid Reset Request for \"" + username + "\", Ignored");
            return "There was an error processing your request.";
        }
View Full Code Here

        sess.removeAttribute(PIN_VALIDATED);

        String emailOid = req.getParameter("oid");
        log.debug("activateAccount got an emailOid: " + emailOid);

        AccountRequest accountRequest = null;
        try {
            accountRequest = checkEmailOid(emailOid);
        } catch (Exception e) {
            errorMessage.setValue(e.getMessage());
            setNextState(req, OID_PROMPT_JSP);
View Full Code Here

        PortletSession sess = req.getPortletSession();

        TextBean errorMessage = event.getTextBean("errorMessage");
        errorMessage.setStyle("error");

        AccountRequest accountRequest =
            (AccountRequest)sess.getAttribute(PROCESSING_REQUEST);
        if (accountRequest == null) {
            log.error("Couldn't get AccountRequest from Session Attribute.");
            errorMessage.setValue("There was an error processing your request. Please click the link in the email you received again to start the process over, or contact the portal administrator if you continue to see this message.");
            setNextState(req, ERROR_JSP);
            return ;
        }

        String pin = req.getParameter("pinNumber");
        String pinNumber = null;
        if ( accountRequest.isRenewRequest() ) {
            log.info("Requests Account Renewal.");
            pinNumber = accountRequest.getAttribute("renewPIN");
        } else if (accountRequest.isResetRequest() ) {
            log.info("Requests to reset account.");
            pinNumber = accountRequest.getAttribute("resetPIN");
        } else {
            log.info("Requests Account Activation.");
            pinNumber = accountRequest.getAttribute("pinNumber");
        }
        try {
            checkPIN(pin, pinNumber);
        } catch (Exception e) {
            log.error(e.getMessage());
View Full Code Here

            errorMessage.setValue("Error. You must enter PIN number.");
            setNextState(req, PIN_PROMPT_JSP);
            return ;
        }

        AccountRequest accountRequest =
            (AccountRequest)sess.getAttribute(PROCESSING_REQUEST);
        if (accountRequest == null) {
            errorMessage.setValue("There was an error processing your request. Please click the link in the email you received again to start the process over, or contact the portal administrator if you continue to see this message.");
            sess.removeAttribute(PROCESSING_REQUEST);
            sess.setAttribute(PIN_VALIDATED, Boolean.FALSE);
            setNextState(req, ERROR_JSP);
            return ;
        }

        String password1 = req.getParameter("password1");
        String password2 = req.getParameter("password2");
        try {
            checkPassword(password1, password2, accountRequest);
        } catch (Exception e) {
            log.info(e.getMessage());
            errorMessage.setValue(e.getMessage());
            setNextState(req, PASSWORD_PROMPT_JSP);
            return ;
        }

        // activation proc
        Map params = new HashMap();
        params.put("password", password1);
        AccountRequestResult result =
            accountService.updateAccount(accountRequest,
                                         AccountRequest.Status.ACTIVATED,
                                         params);
        if (result.isError()) {
            errorMessage.setValue( result.getMessage() );
            setNextState(req, ERROR_JSP);
            return ;
        }

        errorMessage.setValue(null);
        sess.removeAttribute(PROCESSING_REQUEST);
        sess.removeAttribute(PIN_VALIDATED);

        res.setRenderParameter("username", accountRequest.getUsername());

        setNextState(req, ACTIVATION_COMPLETE_JSP);
        log.debug("Exit activateAccount");
    }
View Full Code Here

        if ((message = validator.validatePassword(newPassword)) != null) {
            res.setRenderParameter("errorMessage", message);
            return ;
        }

        AccountRequest accountRequest =
            accountService.getAccountRequestByUsername(username);
        if (accountRequest == null) {
            res.setRenderParameter("errorMessage",
                "No account found for " + username);
            return ;
        }
        if ((message = validator.passwordCheckByAccountInfo(
            accountRequest.getAttributes(), newPassword)) != null ) {
            res.setRenderParameter("errorMessage", message);
            return ;
        }

        String nextState = CHANGE_PASSWORD_JSP;
View Full Code Here

        }
        */
    }

    public void saveAccount(Map params) {
        AccountRequest request = new AccountRequest();
        request.setAttributes( params );
        request.setUsername( (String)params.get("username") );
        request.setEmailAddress( (String)params.get("emailAddress") );
        request.setOpenId( (String)params.get("openid") );
        request.setAccountType((String)params.get("account_type"));
        request.appendAdminComments("Request requires admin approval");
        String dn = buildUserDN(request);
        request.setAttribute("predictedSubject", dn);
        if ( log.isDebugEnabled() ) {
            log.debug("Save AccountRequest: \n" + request);
        }

        save(request);
View Full Code Here

TOP

Related Classes of org.geogrid.aist.tsukubagama.services.request.AccountRequest

Copyright © 2018 www.massapicom. 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.