Package org.opencustomer.db.vo.system

Examples of org.opencustomer.db.vo.system.UserVO


    }

    @Override
    public void loadEnvironment(ActionMessages errors, LoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    {
        UserVO activeUser = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);

        List<LocaleUtility.LocaleBean> locales = new ArrayList<LocaleUtility.LocaleBean>();
        for(Locale locale : LocaleUtility.getInstance().getLocales()) {
            locales.add(new LocaleUtility.LocaleBean(locale, MessageUtil.message(request, "locale."+locale)));
        }
View Full Code Here


    private static Logger log = Logger.getLogger(LoadAction.class);

    @Override
    public EditPanel createPanel(ActionMessages errors, EditLoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    {
        UserVO user = (UserVO)attributes.get("user");

        EditPanel panel = new EditPanel(Right.ADMINISTRATION_USERPROFILE_WRITE, user);
       
        panel.setTitle(MessageUtil.message(request, "module.system.user.profile.default.title"));
       
View Full Code Here

    }
   
    @Override
    public void loadEntity(ActionMessages errors, EditLoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    {
        UserVO activeUser = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
       
        try
        {
            UserVO user = new UserDAO().getById(activeUser.getId());
            attributes.put("user", user);
           
            UserLoginLogDAO dao = new UserLoginLogDAO();
            UserLoginLogVO lastInvalidLogin = dao.getLastInvalidLoginForUser(user);
            if(lastInvalidLogin != null)
View Full Code Here

    private static Logger log = Logger.getLogger(PageStandardAction.class);

    @Override
    public void readForm(PageStandardForm form, ActionMessages errors, HttpServletRequest request)
    {
        UserVO activeUser     = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
        UsergroupVO usergroup = (UsergroupVO) getPanel().getEntity();

        usergroup.setName(form.getName());
        if(usergroup.getId() == null && activeUser.getProfile().getRole().isAdmin())
            usergroup.setAdmin(form.isAdmin());
    }
View Full Code Here

        {
            if (oldPassword == null)
                errors.add("oldPassword", new ActionMessage("default.error.missingInput", MessageUtil.message(request, "module.system.user.profile.changePassword.oldPassword")));
            else
            {
                UserVO user = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
                if (!SignatureUtility.getInstance().isSignatureValid(user.getPassword(), oldPassword))
                    errors.add("oldPassword", new ActionMessage("module.system.user.profile.changePassword.error.invalidPassword", MessageUtil.message(request, "module.system.user.profile.changePassword.oldPassword")));
            }
   
            if (newPassword1 == null)
                errors.add("newPassword1", new ActionMessage("default.error.missingInput", MessageUtil.message(request, "module.system.user.profile.changePassword.newPassword1")));
View Full Code Here

    private static Logger log = Logger.getLogger(PageStandardAction.class);

    @Override
    public void readForm(PageStandardForm form, ActionMessages errors, HttpServletRequest request)
    {
        UserVO user = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);

        UserVO editUser = (UserVO) getPanel().getEntity();
        boolean isActiveUser = false;
        if(getPanel().getAttribute("isActiveUser") != null)
            isActiveUser = (Boolean)getPanel().getAttribute("isActiveUser");
        boolean isLdapUser = (Boolean)getPanel().getAttribute("isLdapUser");
       
        if(!isLdapUser) {       
            editUser.setUserName(form.getUserName());
            if(!isActiveUser)
                editUser.getProfile().setLocked(form.isLocked());
            editUser.getProfile().setTimeLock(form.getTimeLock());
            editUser.getProfile().setIpPattern(form.getIpPattern());
           
            if(!isActiveUser) {
                SimpleDateFormat sdf = new SimpleDateFormat(MessageUtil.message(request, "default.format.input.dateTime"));
                try
                {
                    if(form.getValidFrom() != null)
                        editUser.getProfile().setValidFrom(sdf.parse(form.getValidFrom()));
                    else
                        editUser.getProfile().setValidFrom(null);
                    if(form.getValidUntil() != null)
                        editUser.getProfile().setValidUntil(sdf.parse(form.getValidUntil()));
                    else
                        editUser.getProfile().setValidUntil(null);
                }
                catch (ParseException e)
                {
                    log.error("problems parsing event time validFrom/validUntil", e);
                }
            }
            if (form.getUserPassword() != null && !isActiveUser)
                editUser.setPassword(SignatureUtility.getInstance().createSignature(form.getUserPassword()));
   
            if (form.getMainUsergroupId() > 0)
            {
                Iterator<UsergroupVO> usergroups = editUser.getProfile().getUsergroups().iterator();
                while (usergroups.hasNext())
                {
                    UsergroupVO usergroup = usergroups.next();
                    if (usergroup.getId() == form.getMainUsergroupId())
                    {
                        editUser.getProfile().setDefaultUsergroup(usergroup);
                        break;
                    }
                }
            }
        }
       
        editUser.setLocale(LocaleUtility.parseLocale(form.getLocale()));
    }
View Full Code Here

    }
   
    @Override
    public void writeForm(PageStandardForm form, ActionMessages errors, HttpServletRequest request)
    {
        UserVO editUser = (UserVO) getPanel().getEntity();

        form.setUserName(editUser.getUserName());
        form.setLocked(editUser.getProfile().isLocked());
        form.setIpPattern(editUser.getProfile().getIpPattern());
        if (editUser.getProfile().getDefaultUsergroup() != null)
            form.setMainUsergroupId(editUser.getProfile().getDefaultUsergroup().getId());
        form.setTimeLock(editUser.getProfile().getTimeLock());
        form.setLocale(editUser.getLocale().toString());
       
        SimpleDateFormat sdf = new SimpleDateFormat(MessageUtil.message(request, "default.format.input.dateTime"));
        if (editUser.getProfile().getValidFrom() != null)
            form.setValidFrom(sdf.format(editUser.getProfile().getValidFrom()));
        if (editUser.getProfile().getValidUntil() != null)
            form.setValidUntil(sdf.format(editUser.getProfile().getValidUntil()));
    }
View Full Code Here

    private static Logger log = Logger.getLogger(PageStandardAction.class);
   
    @Override
    protected void writeForm(PageStandardForm form, ActionMessages errors, HttpServletRequest request)
    {
        UserVO user = (UserVO)getPanel().getEntity();
       
        form.setLocale(user.getLocale().toString());
    }
View Full Code Here

    }
   
    @Override
    public void readForm(PageStandardForm form, ActionMessages errors, HttpServletRequest request)
    {
        UserVO user = (UserVO)getPanel().getEntity();

        if(form.getNewPassword1() != null)
            user.setPassword(SignatureUtility.getInstance().createSignature(form.getNewPassword1()));
       
        user.setLocale(LocaleUtility.parseLocale(form.getLocale()));
    }
View Full Code Here

        else if (form.getDoRemoveUsergroup() > 0)
        {
            if (log.isDebugEnabled())
                log.debug("remove usergroup with id: "+form.getDoRemoveUsergroup());         
           
            UserVO user = (UserVO) getPanel().getEntity();

            Iterator<UsergroupVO> it = user.getProfile().getUsergroups().iterator();
            while(it.hasNext()) {
                if(it.next().getId().intValue() == form.getDoRemoveUsergroup()) {
                    it.remove();
                    break;
                }
            }
           
            return Panel.getForward(getPanel().getActivePage().getAction(), request);
        }
        else if (form.getDoRemovePerson().isSelected())
        {
            if (log.isDebugEnabled())
                log.debug("remove person");

            UserVO user = (UserVO)getPanel().getEntity();
            user.setPerson(null);
           
            return Panel.getForward(getPanel().getActivePage().getAction(), request);
        }
        else
        {
View Full Code Here

TOP

Related Classes of org.opencustomer.db.vo.system.UserVO

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.