Makes a list item from a user.<p>

@param user the user

@return the list item
514848
protected CmsListItem makeListItem(CmsUser user) {

        CmsListItem item = getList().newItem(user.getId().toString());
        item.set(LIST_COLUMN_LOGIN, user.getName());
        item.set(LIST_COLUMN_FULLNAME, user.getFullName());
        return item;

    }
780949
public static CmsListItemWidget createListItemWidget(CmsPublishResource resourceBean, int[] slotMapping) {

        CmsListItemWidget itemWidget = new CmsListItemWidget(resourceBean);
        if (resourceBean.getUserLastModified() != null) {
            String userLabel = org.opencms.ade.publish.client.Messages.get().key(
                org.opencms.ade.publish.client.Messages.GUI_LABEL_USER_LAST_MODIFIED_0);
            itemWidget.addAdditionalInfo(
                new CmsAdditionalInfoBean(userLabel, resourceBean.getUserLastModified(), null));
        }
        if (resourceBean.getDateLastModifiedString() != null) {
            String dateLabel = org.opencms.ade.publish.client.Messages.get().key(
                org.opencms.ade.publish.client.Messages.GUI_LABEL_DATE_LAST_MODIFIED_0);
            itemWidget.addAdditionalInfo(
                new CmsAdditionalInfoBean(dateLabel, resourceBean.getDateLastModifiedString(), null));
        }

        String resourceUser = resourceBean.getUserLastModified();
        String currentUser = CmsCoreProvider.get().getUserInfo().getName();
        if (!currentUser.equals(resourceUser)) {
            itemWidget.setTopRightIcon(
                I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().changed(),
                Messages.get().key(Messages.GUI_CHANGED_BY_USER_1, resourceBean.getUserLastModified()));
        }
        for (int i = 0; i < NUM_BUTTON_SLOTS; i++) {
            SimplePanel panel = new SimplePanel();
            panel.getElement().getStyle().setWidth(20, Unit.PX);
            panel.getElement().getStyle().setHeight(20, Unit.PX);
            if (i == slotMapping[SLOT_WARNING]) {
                panel.addStyleName(I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().permaVisible());
            }
            itemWidget.addButton(panel);
        }

        if (CmsPublishDataModel.hasProblems(resourceBean)) {
            Widget warningImage = FontOpenCms.WARNING.getWidget(20, I_CmsConstantsBundle.INSTANCE.css().colorWarning());
            warningImage.setTitle(resourceBean.getInfo().getValue());
            warningImage.addStyleName(I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().permaVisible());
            fillButtonSlot(itemWidget, SLOT_WARNING, warningImage, slotMapping);
        }
        itemWidget.setUnselectable();
        return itemWidget;
    }
321178
@Override
  public List<String> getGroups(String user) throws IOException {
    List<String> groups = CommonUtils.getUnixGroups(user);
    // remove duplicated primary group
    return new ArrayList<>(new LinkedHashSet<>(groups));
  }
898293
public static void setUser(Object user)
    {
        HttpSession session = WebContextFactory.get().getSession(true);
        session.setAttribute(USER, user);
    }
723766
@Programmatic
    public List<SessionLogEntry> findRecentByUser(final String user) {
        return repositoryService.allMatches(
                new QueryDefault<>(SessionLogEntry.class, "findRecentByUser", "user", user));

    }
1206550
public PaginatedList<User> list(int page) {
		PaginatedList<User> results = new PaginatedList<User>();
		Criteria criteria = this.dao.newCriteria(User.class).setFirstResult(page * 10).setMaxResults(10)
				.addOrder(Order.asc("name"));
		Criteria counting = this.dao.newCriteria(User.class).setProjection(Projections.countDistinct("id"));
		results.setList(this.dao.findByCriteria(criteria, User.class));
		results.setTotal((Long) counting.uniqueResult());
		return results;
	}
830248
public void setUserParam(String user) {
		try {
			getSipURI().setUserParam(user);
			super.parameters.put(USER, user);
		} catch (ParseException e) {
			logger.error("error setting parameter ", e);
		}
	}
410756
@Programmatic
    public List<CommandJdo> findRecentByUser(final String user) {
        return repositoryService.allMatches(
                new QueryDefault<>(CommandJdo.class, "findRecentByUser", "user", user));

    }
33939
protected void fillItem(Item item, CmsUser user) {

        item.getItemProperty(TableProperty.Name).setValue(user.getSimpleName());
        item.getItemProperty(TableProperty.FullName).setValue(user.getFullName());
        item.getItemProperty(TableProperty.SystemName).setValue(user.getName());
        boolean disabled = !user.isEnabled();
        item.getItemProperty(TableProperty.DISABLED).setValue(new Boolean(disabled));
        boolean newUser = user.getLastlogin() == 0L;
        item.getItemProperty(TableProperty.NEWUSER).setValue(new Boolean(newUser));
        try {
            item.getItemProperty(TableProperty.OU).setValue(
                OpenCms.getOrgUnitManager().readOrganizationalUnit(m_cms, user.getOuFqn()).getDisplayName(
                    A_CmsUI.get().getLocale()));
        } catch (CmsException e) {
            LOG.error("Can't read OU", e);
        }
        item.getItemProperty(TableProperty.LastLogin).setValue(new Long(user.getLastlogin()));
        item.getItemProperty(TableProperty.Created).setValue(new Long(user.getDateCreated()));
        item.getItemProperty(TableProperty.INDIRECT).setValue(new Boolean(m_indirects.contains(user)));
        item.getItemProperty(TableProperty.FROMOTHEROU).setValue(new Boolean(!user.getOuFqn().equals(m_ou)));
        item.getItemProperty(TableProperty.STATUS).setValue(getStatusInt(disabled, newUser));
    }
1369085
public List<User> getAllUser(){
        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.GetAllUser);

        Response resp = connection.submitRequest(header, null, null);
        return ((GetAllUserResponse) resp).getUsers();
    }
392353
public java.util.List<User> getUsers() {
        if (users == null) {
            users = new com.amazonaws.internal.SdkInternalList<User>();
        }
        return users;
    }
1141887
protected List<CmsPrincipal> getUsers() throws CmsException {

        List<CmsPrincipal> ret = new ArrayList<CmsPrincipal>();
        if (getParamGroup() != null) {
            ret.addAll(getCms().getUsersOfGroup(getParamGroup()));
        } else {
            ret.addAll(OpenCms.getRoleManager().getManageableUsers(getCms(), "", true));
        }
        if (getParamFlags() != null) {
            int flags = Integer.parseInt(getParamFlags());
            return new ArrayList<CmsPrincipal>(CmsPrincipal.filterFlag(ret, flags));
        }
        return ret;
    }
579454
@SuppressWarnings("unchecked")
    protected void initUserObject() {

        try {
            if (CmsStringUtil.isEmpty(getParamAction()) || CmsDialog.DIALOG_INITIAL.equals(getParamAction())) {
                // edit an existing user, get the user object from db
                m_user = getCms().readUser(new CmsUUID(getParamUserid()));
                if (!Boolean.valueOf(getParamEditall()).booleanValue()) {
                    m_addInfoList = createAddInfoList(m_user);
                } else {
                    setAddInfoMaps();
                }
                return;
            } else {
                // this is not the initial call, get the user object from session
                m_user = getCms().readUser(new CmsUUID(getParamUserid()));
                if (!Boolean.valueOf(getParamEditall()).booleanValue()) {
                    m_addInfoList = (List<CmsUserAddInfoBean>)getDialogObject();
                } else {
                    Map<String, SortedMap<String, Object>> dObj = (Map<String, SortedMap<String, Object>>)getDialogObject();
                    m_addInfoEditable = dObj.get("editable");
                    m_addInfoReadOnly = dObj.get("readonly");
                }
                return;
            }
        } catch (Exception e) {
            // noop
        }
        // create a new user object
        try {
            m_user = getCms().readUser(new CmsUUID(getParamUserid()));
        } catch (CmsException e) {
            // ignore
        }
        if (!Boolean.valueOf(getParamEditall()).booleanValue()) {
            m_addInfoList = createAddInfoList(m_user);
        } else {
            setAddInfoMaps();
        }
    }
1202548
private static Set<String> extractUserRoles(final UsersType.User user) {
        Set<String> roles = new TreeSet<>();
        if (user == null) {
            return roles;
        }

        if (user.getRoles() != null && !user.getRoles().trim().isEmpty()) {
            String [] rolelist = user.getRoles().trim().split(",");
            for (String role: rolelist) {
                if( role == null || role.trim().isEmpty()) {
                    continue;
                }
                roles.add(role.trim().toLowerCase());
            }
        }

        return roles;
    }
113392
public List<CmsResource> getUsersPubList(CmsRequestContext context) throws CmsException {

        List<CmsResource> result = null;
        CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
        try {
            result = m_driverManager.getUsersPubList(dbc, context.getCurrentUser().getId());
        } catch (Exception e) {
            dbc.report(
                null,
                Messages.get().container(Messages.ERR_READ_USER_PUBLIST_1, context.getCurrentUser().getName()),
                e);

        } finally {
            dbc.clear();
        }
        return result;
    }
1234972
public Set<Role> findRoles(final User user)
    {
        final Set<Role> result = new HashSet<Role>();
        
        for(final RoleMapping mapping : this.getRoleMappings())
        {
            final Object source = mapping.getSource();
            
            if((user != null) && user.equals(source))
            {
                // TODO: Fix this hardcoding when Restlet implements equals for Role objects again
                RestletUtilRole standardRole = this.getRoleByName(mapping.getTarget().getName());
                if(standardRole != null)
                {
                    result.add(standardRole.getRole());
                }
                else
                {
                    result.add(mapping.getTarget());
                }
            }
        }
        
        return result;
    }
364828
public CompletableFuture<Member> getMember(String projectName, User user) {
        requireNonNull(projectName, "projectName");
        requireNonNull(user, "user");

        return getProject(projectName).thenApply(
                project -> project.memberOrDefault(user.id(), null));
    }