Package org.opencustomer.db.dao.system

Examples of org.opencustomer.db.dao.system.UserLoginLogDAO


           
            try {
                HibernateContext.beginTransaction();

                if(loginLog != null)
                    new UserLoginLogDAO().insert(loginLog);
               
                new UserDAO().update(user);
               
                HibernateContext.commitTransaction();
            } catch (HibernateException e) {
View Full Code Here


            } else if (ipAddress != null && !IpAddressPatternValidator.getInstance().match(user.getProfile().getIpPattern(), ipAddress)) {
                if(log.isDebugEnabled())
                    log.debug("user has no access from ip: "+ipAddress);
                errors.add("invalidIpAddress", new ActionMessage("module.common.login.error.invalidIpAddress", ipAddress));
            } else {
                long failedLogins = new UserLoginLogDAO().countInvalidLoginsForUser(user);

                if (user.getProfile().isProfileLocked()) {
                    errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("module.common.login.error.userLocked"));
                } else if (failedLogins >= SystemConfiguration.getInstance().getIntValue(SystemConfiguration.Key.MAX_FAILED_LOGINS)
                        && user.getProfile().getTimeLock() > 0
                        && validatePassword(user, password)) {
                    UserLoginLogVO lastInvalidLogin = new UserLoginLogDAO().getLastInvalidLoginForUser(user);
                    if(lastInvalidLogin != null) {
                        Calendar cal = GregorianCalendar.getInstance();
                        cal.setTime(lastInvalidLogin.getLoginDate());
                        cal.add(Calendar.MINUTE, user.getProfile().getTimeLock());
                        if (!new Date().after(cal.getTime()))
View Full Code Here

        try
        {
            UserVO user = new UserDAO().getById(form.getId());
            attributes.put("user", user);
           
            UserLoginLogDAO dao = new UserLoginLogDAO();
            UserLoginLogVO lastValidLogin = dao.getLastValidLoginForUser(user);
            if(lastValidLogin != null)
                attributes.put("lastValidLogin", lastValidLogin);
            UserLoginLogVO lastInvalidLogin = dao.getLastInvalidLoginForUser(user);
            if(lastInvalidLogin != null)
                attributes.put("lastInvalidLogin", lastInvalidLogin);
            attributes.put("invalidLoginCount", dao.countInvalidLoginsForUser(user));

        }
        catch (HibernateException e)
        {
            e.printStackTrace();
View Full Code Here

        try
        {
            UserVO user = new UserDAO().getById(activeUser.getId());
            attributes.put("user", user);
           
            UserLoginLogDAO dao = new UserLoginLogDAO();
            UserLoginLogVO lastInvalidLogin = dao.getLastInvalidLoginForUser(user);
            if(lastInvalidLogin != null)
                attributes.put("lastInvalidLogin", lastInvalidLogin);
        }
        catch (HibernateException e)
        {
View Full Code Here

TOP

Related Classes of org.opencustomer.db.dao.system.UserLoginLogDAO

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.