/** * Returns all users.<p> * * @return a list of all <code>{@link CmsUser}</code> objects * * @throws CmsException if operation was not successful * * @deprecated use {@link org.opencms.security.CmsOrgUnitManager#getUsers(CmsObject, String, boolean) OpenCms.getOrgUnitManager().getUsersForOrganizationalUnit(CmsObject, String, boolean)} instead */ public List getUsers() throws CmsException { return OpenCms.getOrgUnitManager().getUsers(this, "", true); }
/** * Returns all users of organizational units for which the current user has * the {@link CmsRole#ACCOUNT_MANAGER} role.<p> * * @param cms the current cms context * @param ouFqn the fully qualified name of the organizational unit * @param includeSubOus if sub organizational units should be included in the search * @param includeWebusers if webuser organizational units should be included in the search * * @return a list of {@link org.opencms.file.CmsUser} objects * * @throws CmsException if something goes wrong */ public List<CmsUser> getManageableUsers(CmsObject cms, String ouFqn, boolean includeSubOus, boolean includeWebusers) throws CmsException { List<CmsOrganizationalUnit> ous = getManageableOrgUnits(cms, ouFqn, includeSubOus, includeWebusers); List<CmsUser> users = new ArrayList<CmsUser>(); Iterator<CmsOrganizationalUnit> it = ous.iterator(); while (it.hasNext()) { CmsOrganizationalUnit orgUnit = it.next(); users.addAll(OpenCms.getOrgUnitManager().getUsers(cms, orgUnit.getName(), false)); } return users; }
/** * Checks if the given user name is already available inside the current ou.<p> * * @param userName the user name to check * @return <code>true</code> if the user name is already available, otherwise return <code>false</code> */ protected boolean isAlreadyAvailable(String userName) { List availableUsers; try { availableUsers = OpenCms.getOrgUnitManager().getUsers(getCms(), getParamOufqn(), false); } catch (CmsException e) { availableUsers = new ArrayList(); } Iterator itAvailableUsers = availableUsers.iterator(); while (itAvailableUsers.hasNext()) { if (userName.equals(((CmsUser)itAvailableUsers.next()).getSimpleName())) { return true; } } return false; }
/** * Returns a map with the users to export added.<p> * * @param exportUsers the map to add the users * * @return a map with the users to export added * * @throws CmsException if getting users failed */ protected Map<CmsUUID, CmsUser> getExportAllUsers(Map<CmsUUID, CmsUser> exportUsers) throws CmsException { List<CmsUser> users = OpenCms.getOrgUnitManager().getUsers(getCms(), getParamOufqn(), false); if ((users != null) && (users.size() > 0)) { Iterator<CmsUser> itUsers = users.iterator(); while (itUsers.hasNext()) { CmsUser user = itUsers.next(); if (!exportUsers.containsKey(user.getId())) { exportUsers.put(user.getId(), user); } } } return exportUsers; }
/** * Returns the list of users to display.<p> * * @return the list of users to display * * @throws CmsException if something goes wrong */ protected List<CmsUser> getUsers() throws CmsException { return CmsPrincipal.filterCoreUsers(OpenCms.getOrgUnitManager().getUsers(getCms(), "", true)); }
/** * Returns all users of organizational units for which the current user has * the {@link CmsRole#ACCOUNT_MANAGER} role.<p> * * @param cms the current cms context * @param ouFqn the fully qualified name of the organizational unit * @param includeSubOus if sub organizational units should be included in the search * @param includeWebusers if webuser organizational units should be included in the search * * @return a list of {@link org.opencms.file.CmsUser} objects * * @throws CmsException if something goes wrong */ public List getManageableUsers(CmsObject cms, String ouFqn, boolean includeSubOus, boolean includeWebusers) throws CmsException { List users = new ArrayList(); Iterator it = getOrgUnitsForRole(cms, CmsRole.ACCOUNT_MANAGER.forOrgUnit(ouFqn), includeSubOus).iterator(); while (it.hasNext()) { CmsOrganizationalUnit orgUnit = (CmsOrganizationalUnit)it.next(); if (!includeWebusers && orgUnit.hasFlagWebuser()) { // webuser are never manageable continue; } users.addAll(OpenCms.getOrgUnitManager().getUsers(cms, orgUnit.getName(), false)); } return users; }
Iterator<CmsUser> ituser = OpenCms.getOrgUnitManager().getUsers(cms, "/", true).iterator(); int i = 0; while (ituser.hasNext()) {
/** * @see org.opencms.workplace.tools.accounts.A_CmsUsersList#getUsers() */ @Override protected List<CmsUser> getUsers() throws CmsException { return CmsPrincipal.filterCoreUsers(OpenCms.getOrgUnitManager().getUsers(getCms(), getParamOufqn(), false)); }
try { if (detailId.equals(LIST_DETAIL_USERS)) { List<CmsUser> usersOrgUnit = OpenCms.getOrgUnitManager().getUsers(getCms(), ouFqn, false); Iterator<CmsUser> itUsersOrgUnit = usersOrgUnit.iterator(); while (itUsersOrgUnit.hasNext()) {
List<CmsUser> currentUsers = OpenCms.getOrgUnitManager().getUsers(getCms(), getParamOufqn(), false);
/** * @see org.opencms.workplace.tools.accounts.A_CmsOrgUnitUsersList#getUsers() */ @Override protected List<CmsUser> getUsers() throws CmsException { @SuppressWarnings("unchecked") List<CmsUser> notOuUsers = (ArrayList<CmsUser>)getJsp().getRequest().getSession().getAttribute( A_CmsOrgUnitUsersList.NOT_ORGUNIT_USERS); if (notOuUsers == null) { List<CmsUser> orgUnitsUser = OpenCms.getOrgUnitManager().getUsers(getCms(), getParamOufqn(), false); List<CmsUser> notOrgUnitUsers = OpenCms.getRoleManager().getManageableUsers(getCms(), "", true); notOrgUnitUsers.removeAll(orgUnitsUser); setNotOuUsers(notOrgUnitUsers); } else { setNotOuUsers(notOuUsers); } return getNotOuUsers(); }
try { String userName = getItem().get(LIST_COLUMN_NAME).toString(); List<CmsUser> currentUsers = OpenCms.getOrgUnitManager().getUsers( getWp().getCms(), ((A_CmsOrgUnitUsersList)getWp()).getParamOufqn(),
try { String userName = getItem().get(LIST_COLUMN_NAME).toString(); List<CmsUser> currentUsers = OpenCms.getOrgUnitManager().getUsers( getWp().getCms(), ((A_CmsOrgUnitUsersList)getWp()).getParamOufqn(),
List<CmsUser> allUsers = OpenCms.getOrgUnitManager().getUsers(getCms(), orgunit.getName(), false); for (int i = 0, l = allUsers.size(); i < l; i++) { CmsUser user = allUsers.get(i);
List<CmsUser> allUsers = OpenCms.getOrgUnitManager().getUsers(getCms(), orgunit.getName(), false); for (int i = 0, l = allUsers.size(); i < l; i++) { CmsUser user = allUsers.get(i);
if (OpenCms.getOrgUnitManager().getUsers(wp.getCms(), ouFqn, true).size() > 0) { return false;