Package org.opencustomer.db.vo.system

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


        }
    }
   
    @Override
    public void createEntity(ActionMessages errors, LoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        UserVO activeUser = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
        Panel lastPanel = null;
        if(!Panel.getPanelStack(request).isEmpty())
            lastPanel = Panel.getPanelStack(request).peek();
       
        PersonVO person = new PersonVO();
       
        if(lastPanel != null && lastPanel instanceof EditPanel && ((EditPanel)lastPanel).getEntity() instanceof CompanyVO) {
            person.setCompany((CompanyVO)((EditPanel)lastPanel).getEntity());
        }
       
        person.setAccessUser(EntityAccess.Access.WRITE_SYSTEM);
        person.setOwnerUser(activeUser.getId());
        person.setAccessGroup(EntityAccess.Access.NONE);
        person.setOwnerGroup(activeUser.getProfile().getDefaultUsergroup().getId());
        person.setAccessGlobal(EntityAccess.Access.WRITE_SYSTEM);
       
        attributes.put("person", person);
    }
View Full Code Here


        if (form.getDoAddOwnPerson().isSelected())
        {
            if (log.isDebugEnabled())
                log.debug("add own person");

            UserVO user = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
            ContactVO contact = (ContactVO) getPanel().getEntity();

            if (user.getPerson() != null)
            {
                PersonContactVO pc = new PersonContactVO(user.getPerson(), contact);

                if (!contact.getPersonContacts().contains(pc))
                    contact.getPersonContacts().add(pc);
            }
View Full Code Here

    protected void chooseEntity(EntityPanel panel, AddUserForm form, ActionMessages errors, HttpServletRequest request, HttpServletResponse response)
    {
        if (log.isDebugEnabled())
            log.debug("add user with ID: " + form.getId());

        UserVO user = new UserDAO().getById(form.getId());

        if (user == null)
        {
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.invalidEntity", new Integer(form.getId())));

            log.error("problems loading user (ID:" + form.getId() + ")");
        }
        else
        {
            JobVO job = (JobVO) panel.getEntity();

            if(!EntityAccessUtility.isAccessGranted(user, job, EntityAccess.Access.WRITE))
                errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("module.generic.pageSystem.error.missingWriteAccessForAssignedUser", user.getUserName()));
            else
                job.setAssignedUser(user);
        }
    }
View Full Code Here

                if(log.isDebugEnabled())
                    log.debug("do ldap login");
                logon = new LdapLogon();         
            }
           
            UserVO user = logon.validate(form.getLogin(), form.getPassword(), request.getRemoteAddr(), Logon.Type.WEBAPP, errors);
           
            if((user == null || !errors.isEmpty()) && SystemConfiguration.getInstance().getBooleanValue(SystemConfiguration.Key.LDAP_AUTHENTICATION_ENABLED) && !LdapUtil.getInstance().testLdapConnection()) {
                errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("module.common.login.error.noLdapConnection"));
            }
           
            if(errors.isEmpty()) {
                request.getSession().setAttribute(Globals.USER_KEY, user);
                request.getSession().setAttribute(Globals.AUTHENTICATOR_KEY, new Authenticator(user));
                request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY, user.getLocale());
                request.getSession().setAttribute(Globals.CONFIGURATION_KEY, new UserConfiguration(user));
               
                MenuFactory menuFactory = (MenuFactory)request.getSession().getServletContext().getAttribute(Globals.MENU_FACTORY_KEY);
                Menu menu = menuFactory.getCustomizedMenu(AuthenticatorUtility.getAuthenticator(request));
                request.getSession().setAttribute(Globals.MENU_KEY, menu);
View Full Code Here

        }
    }
   
    @Override
    protected boolean validateData(EditPanel panel, ActionMessages errors, HttpServletRequest request) {
        UserVO user                           = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
        ListConfigurationVO listConfiguration = (ListConfigurationVO) panel.getEntity();
       
        if (listConfiguration.getName() != null) {
            try {
                ListConfigurationDAO dao = new ListConfigurationDAO();
View Full Code Here

        if(Globals.USER_KEY.equals(event.getName())) {
            if(log.isDebugEnabled())
                log.debug("user logged in: "+((UserVO)event.getValue()).getUserName());
           
            if(!SystemConfiguration.getInstance().getBooleanValue(SystemConfiguration.Key.MULTIPLE_LOGINS)) {
                UserVO user = (UserVO)event.getSession().getAttribute(Globals.USER_KEY);
               
                for(HttpSession session : getSessionsByUser(user.getUserName())) {
                    session.invalidate();
                }
            }
           
            sessions.add(event.getSession());
View Full Code Here

   
    private Set<HttpSession> getSessionsByUser(String userName) {
        Set<HttpSession> userSessions = new HashSet<HttpSession>();
       
        for(HttpSession session : sessions) {
            UserVO user = (UserVO)session.getAttribute(Globals.USER_KEY);
            if(user.getUserName().equals(userName)) {
                userSessions.add(session);
            }
        }
       
        if(log.isDebugEnabled()) {
View Full Code Here

public class SaveAction extends EditSaveAction {
    private static Logger log = Logger.getLogger(SaveAction.class);

    @Override
    protected void saveEntity(EditPanel panel, ActionMessages errors, HttpServletRequest request) {
        UserVO user                          = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
        Iterator<ConfigurationVO> configurations = ((List<ConfigurationVO>)panel.getAttribute("configurations")).iterator();
       
        try {
            HibernateContext.beginTransaction();
           
View Full Code Here

    @Override
    public void createEntity(ActionMessages errors, LoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        if (log.isDebugEnabled())
            log.debug("create list configuration (type:"+attributes.get("defaultType")+")");

        UserVO user   = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
       
        ListConfigurationVO listConfiguration = new ListConfigurationVO();
       
        ListConfigurationVO.Type type = (ListConfigurationVO.Type)attributes.get("defaultType");
       
View Full Code Here

    }
   
    @Override
    public void createEntity(ActionMessages errors, EditLoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    {
        UserVO activeUser = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
       
        JobVO job = new JobVO();
        job.setStatus(JobVO.Status.PLANNED);
        job.setPriority(JobVO.Priority.MEDIUM);
       
        job.setAccessUser(EntityAccess.Access.WRITE_SYSTEM);
        job.setOwnerUser(activeUser.getId());
        job.setAccessGroup(EntityAccess.Access.NONE);
        job.setOwnerGroup(activeUser.getProfile().getDefaultUsergroup().getId());
        job.setAccessGlobal(EntityAccess.Access.WRITE_SYSTEM);
       
        if(Panel.getPanelStack(request).peek() instanceof EditPanel) {
            EditPanel lastPanel = (EditPanel)Panel.getPanelStack(request).peek();
           
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.