Examples of LogonForm


Examples of com.adito.security.forms.LogonForm

                return accountLocked(mapping, request, ale, msgs);
            } catch (InvalidLoginCredentialsException ex) {
                log.error("[" + request.getRemoteHost()
                    + "] authentication failed", ex);

                LogonForm logonForm = (LogonForm) form;

                CoreServlet.getServlet().fireCoreEvent(
                    new CoreEvent(this, CoreEventConstants.LOGON, null, null, ex).addAttribute(
                        CoreAttributeConstants.EVENT_ATTR_IP_ADDRESS, request.getRemoteAddr()).addAttribute(
                        CoreAttributeConstants.EVENT_ATTR_HOST, request.getRemoteHost()).addAttribute(
                        CoreAttributeConstants.EVENT_ATTR_SCHEME, scheme.getSchemeName()).addAttribute(
                        CoreAttributeConstants.EVENT_ATTR_ACCOUNT, logonForm.getUsername()));

               
              request.getSession().removeAttribute(LogonStateAndCache.LOGON_STATE_MACHINE);
                request.getSession().removeAttribute(Constants.AUTH_SESSION);
View Full Code Here

Examples of com.adito.security.forms.LogonForm

    /* (non-Javadoc)
     * @see com.adito.core.actions.DefaultAction#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        LogonForm logonForm = (LogonForm) form;
       
        /*
         * The logon page should not be shown if already logged on. It is
         * important that hasClientLoggedOn is called first, as this is what
         * places the session lock in the session attributes.
View Full Code Here

Examples of org.jresearch.gossip.forms.LogonForm

        }

        // Extract attributes we will need
        HttpSession session = request.getSession();
        MessageResources messages = getResources(request);
        LogonForm logonForm = (LogonForm) form;
        User user = new User();

        ActionErrors errors = new ActionErrors();

        String username = logonForm.getUsername();
        String password = logonForm.getPassword();

        UserDAO userDAO = UserDAO.getInstance();

        try {

            user = userDAO.getUser(username, password);
            user.setIp(request.getRemoteAddr());

            if (user.getStatus() == 0) {
                errors.add(ActionErrors.GLOBAL_ERROR,
                    new ActionError("forum.LOG_FAIL",
                        new Object[] {
                            response.encodeURL("showFogotPass.do?uid=" +
                                username)
                        }));
                JGossipLog.audit(
          LogLevel.WARN,
          user,
          messages.getMessage("logs.LOG2")+" \""+username+"\"",
          session);
            } else {
                session.setAttribute(IConst.SESSION.USER_KEY, user);
                session.removeAttribute(IConst.SESSION.GROUPS_KEY);
                log(request, "logs.LOG1");
            }
        } catch (SQLException sqle) {
            getServlet().log("Connection.process", sqle);
            throw new SystemException(sqle);
        }

        // Report any errors we have discovered back to the original form
        if (!errors.isEmpty()) {
            saveErrors(request, errors);

            return (mapping.getInputForward());
        }

        if (IConst.VALUES.TRUE.equals(Configurator.getInstance().get(IConst.CONFIG.ENABLE_AUTO_LOGIN))) {
            //set autolog cookies if needed...
            if (user.getSettings().isAutologin()) {
                Cookie userCookie = new Cookie(IConst.COOKIE.USER_COOKIE,
                        user.getName() + "*" + user.getPassword());
                userCookie.setMaxAge(IConst.COOKIE.SECONDS_PER_YEAR);
                ((HttpServletResponse) response).addCookie(userCookie);
            }
        }

        // Remove the obsolete form bean
        if (mapping.getAttribute() != null) {
            if ("request".equals(mapping.getScope())) {
                request.removeAttribute(mapping.getAttribute());
            } else {
                session.removeAttribute(mapping.getAttribute());
            }
        }

        // Forward control to the specified success URI
        String redirectUri = logonForm.getRedirectUri();

        if ((redirectUri != null) && !redirectUri.equals("")) {
            return (new ActionForward(redirectUri, true));
        }

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.