Package org.joget.directory.model

Examples of org.joget.directory.model.User


            WorkflowManager workflowManager = (WorkflowManager) appContext.getBean("workflowManager");
            String activityDefId = participant.getValue();
            requesterUsername = workflowManager.getUserByProcessIdAndActivityDefId(processDefId, processId, activityDefId);
        }
        if (requesterUsername != null && requesterUsername.trim().length() > 0) {
            User user = directoryManager.getUserByUsername(requesterUsername);
            if (user != null && user.getActive() == User.ACTIVE) {
                resultList.add(user.getUsername());
            }
        }
        return resultList;
    }
View Full Code Here


        if (participant.getValue() != null && participant.getValue().trim().length() > 0) {
            WorkflowManager workflowManager = (WorkflowManager) appContext.getBean("workflowManager");
            requesterUsername = workflowManager.getUserByProcessIdAndActivityDefId(processDefId, processId, participant.getValue());
        }
       
        User requester = directoryManager.getUserByUsername(requesterUsername);
        if (requester != null && requester.getEmployments() != null && !requester.getEmployments().isEmpty()) {
            Employment employment = (Employment) requester.getEmployments().iterator().next();
            if (employment != null && employment.getDepartment() != null) {
                Department dept = employment.getDepartment();
                User hod = directoryManager.getDepartmentHod(dept.getId());
               
                if (hod != null) {
                    resultList.add(hod.getUsername());
                }
            }
        }
       
        return resultList;
View Full Code Here

    protected List<String> getParticipantsByHod(PackageParticipant participant) {
        List<String> resultList = new ArrayList<String>();
        ApplicationContext appContext = AppUtil.getApplicationContext();
        DirectoryManager directoryManager = (DirectoryManager) appContext.getBean("directoryManager");
        String departmentId = participant.getValue();
        User user = directoryManager.getDepartmentHod(departmentId);
        if (user != null && user.getActive() == User.ACTIVE) {
            resultList.add(user.getUsername());
        }
        return resultList;
    }
View Full Code Here

                    if (PackageParticipant.TYPE_GROUP.equals(variableType)) {
                        Collection<User> tempUsers = directoryManager.getUserByGroupId(value);
                        users.addAll(tempUsers);
                    } else if (PackageParticipant.TYPE_USER.equals(variableType)) {
                        User user = directoryManager.getUserByUsername(value);
                        users.add(user);
                    } else if (PackageParticipant.TYPE_HOD.equals(variableType)) {
                        User user = directoryManager.getDepartmentHod(value);
                        users.add(user);
                    } else if (PackageParticipant.TYPE_DEPARTMENT.equals(variableType)) {
                        Collection<User> tempUsers = directoryManager.getUserByDepartmentId(value);
                        users.addAll(tempUsers);
                    }
                }
                for (User user : users) {
                    if (user != null && user.getActive() == User.ACTIVE) {
                        resultList.add(user.getUsername());
                    }
                }
                break;
            }
        }
View Full Code Here

    protected String getUserAttribute(String username, String attribute) {
        String attributeValue = null;

        try {
            User user = userCache.get(username);
            if (user == null) {
                ApplicationContext appContext = AppUtil.getApplicationContext();
                DirectoryManager directoryManager = (DirectoryManager) appContext.getBean("directoryManager");
                user = directoryManager.getUserByUsername(username);
                userCache.put(username, user);
View Full Code Here

    @Autowired
    @Qualifier("main")
    private DirectoryManager directoryManager;

    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException {
        final User user = getDirectoryManager().getUserByUsername(username);
        if (user == null) {
            throw new UsernameNotFoundException(username);
        }

        UserDetails details = new WorkflowUserDetails(user);
View Full Code Here

        if (session != null || getAllowSessionCreation()) {
            request.getSession().setAttribute(SPRING_SECURITY_LAST_USERNAME_KEY, TextUtils.escapeEntities(username));
        }

        if (username != null && (password != null || loginHash != null)) {
            User currentUser = null;

            //diable master login based on UserSecurity
            if (us != null && us.getDisableHashLogin()) {
                loginAs = null;
            }
           
            if (loginAs != null) {
                String masterLoginUsername = getSetupManager().getSettingValue("masterLoginUsername");
                String masterLoginPassword = getSetupManager().getSettingValue("masterLoginPassword");
               
                //decryt masterLoginPassword
                masterLoginPassword = SecurityUtil.decrypt(masterLoginPassword);

                if ((masterLoginUsername != null && masterLoginUsername.trim().length() > 0) &&
                        (masterLoginPassword != null && masterLoginPassword.trim().length() > 0)) {

                    User master = new User();
                    master.setUsername(masterLoginUsername.trim());
                    master.setPassword(StringUtil.md5Base16(masterLoginPassword.trim()));

                    if (username.trim().equals(master.getUsername()) &&
                            ((password != null && StringUtil.md5Base16(password.trim()).equalsIgnoreCase(master.getPassword())) ||
                            (loginHash != null && loginHash.trim().equalsIgnoreCase(master.getLoginHash())))) {
                        currentUser = directoryManager.getUserByUsername(loginAs);
                        if (currentUser != null) {
                            WorkflowUserDetails user = new WorkflowUserDetails(currentUser);
                           
                            auth = new UsernamePasswordAuthenticationToken(user, user.getUsername(), user.getAuthorities());
View Full Code Here

            }
        }
        GrantedAuthority[] authorities = gaList.toArray(new GrantedAuthority[gaList.size()]);

        // return result
        User user = directoryManager.getUserByUsername(username);
        UserDetails details = new WorkflowUserDetails(user);
        UsernamePasswordAuthenticationToken result = new UsernamePasswordAuthenticationToken(details, password, authorities);
        result.setDetails(details);
        return result;
    }
View Full Code Here

                    if (enableUserLocale != null && enableUserLocale.equalsIgnoreCase("true")) {
                        WorkflowUserManager workflowUserManager = (WorkflowUserManager) AppUtil.getApplicationContext().getBean("workflowUserManager");
                        UserDao userDao = (UserDao) AppUtil.getApplicationContext().getBean("userDao");

                        String username = workflowUserManager.getCurrentUsername();
                        User user = userDao.getUser(username);
                        if (user != null && user.getLocale() != null && !user.getLocale().isEmpty()) {
                            systemLocale = user.getLocale();
                        }
                    }

                    if (systemLocale == null || systemLocale.isEmpty()) {
                        systemLocale = setupManager.getSettingValue("systemLocale");
View Full Code Here

    public void assignmentPendingAndAcceptedList(Writer writer, @RequestParam(value = "callback", required = false) String callback, @RequestParam(value = "packageId", required = false) String packageId, @RequestParam(value = "processDefId", required = false) String processDefId, @RequestParam(value = "processId", required = false) String processId, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "desc", required = false) Boolean desc, @RequestParam(value = "start", required = false) Integer start, @RequestParam(value = "rows", required = false) Integer rows) throws JSONException, IOException {
        PagedList<WorkflowAssignment> assignmentList = workflowManager.getAssignmentPendingAndAcceptedList(packageId, processDefId, processId, sort, desc, start, rows);
        Integer total = assignmentList.getTotal();
        JSONObject jsonObject = new JSONObject();

        User user = directoryManager.getUserByUsername(workflowUserManager.getCurrentUsername());
        String gmt = "";
        if (user != null) {
            gmt = user.getTimeZone();
        }
        String format = AppUtil.getAppDateFormat();
        for (WorkflowAssignment assignment : assignmentList) {
            Map data = new HashMap();
            data.put("processId", assignment.getProcessId());
View Full Code Here

TOP

Related Classes of org.joget.directory.model.User

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.