Package com.googlecode.memwords.domain

Examples of com.googlecode.memwords.domain.HistoricLogin


        boolean mustRemove = false;
        EntityTransaction tx = em.getTransaction();
        try {
            tx.begin();
            Account account = em.find(Account.class, userId);
            HistoricLogin historicLogin = new HistoricLogin(new Date(), userAgent, ip);
            historicLogin.setAccount(account);
            mustRemove = account.addHistoricLogin(historicLogin);
            tx.commit();
        }
        finally {
            if (tx.isActive()) {
View Full Code Here


                    new LocalizableError("loginFailed"));
            return getContext().getSourcePageResolution();
        }
        getContext().login(userInformation);

        HistoricLogin historicLogin =
            loginHistoryService.getLatestHistoricLogin(userInformation.getUserId());
        if (historicLogin != null) {
            TimeZone timeZone = getContext().getTimeZone();
            DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, getContext().getLocale());
            dateFormat.setTimeZone(timeZone);
            DateFormat timeFormat = DateFormat.getTimeInstance(DateFormat.MEDIUM, getContext().getLocale());
            timeFormat.setTimeZone(timeZone);
            RedirectResolution loginHistoryResolution = new RedirectResolution(LoginHistoryActionBean.class);
            String loginHistoryUrl =
                StringEscapeUtils.escapeHtml(
                     loginHistoryResolution.getUrl(getContext().getLocale()));
            getContext().getMessages().add(new ScopedLocalizableMessage(LoginActionBean.class,
                                                                        "loginSucceededWithLastLogin",
                                                                        dateFormat.format(historicLogin.getDate()),
                                                                        timeFormat.format(historicLogin.getDate()),
                                                                        historicLogin.getIp(),
                                                                        loginHistoryUrl));
        }

        if (requestedUrl != null) {
            return new RedirectResolution(requestedUrl, false);
View Full Code Here

TOP

Related Classes of com.googlecode.memwords.domain.HistoricLogin

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.