mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.2 to HEAD
16673: Merged V3.1 to V3.2 16307: ETHREEOH-2814-2815 16393: ETHREEOH-2840: Failed to send email to group EVERYONE 16395: Just forget to add this file during previous (16393) CHECK-IN. 16430: Added license header to new Java file - applied coding standards and code comments. 16669: Merged V2.2 to V3.1 16650: ETWOTWO-1288 - Create Web project Wizard-Step3 :XSS attack can be made when configuring ASR or FSR 16668: Fix for ETWOTWO-1289 - My Web Files (Forms) dashlets XSS attack can be made when web project's details has been edited 16676: Merged V3.1 to V3.2 16675: Fix for ETHREEOH-2773 - Manage System users: system error happens when search is performed by a query that contains a space 16699: Fixes to SURF samples Login page - as per ALFCOM-3447 and ALFCOM-3448 contributions git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16897 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -505,29 +505,7 @@ public abstract class BaseInviteUsersWizard extends BaseWizardBean
|
||||
}
|
||||
else
|
||||
{
|
||||
// groups - text search match on supplied name
|
||||
String term = PermissionService.GROUP_PREFIX + "*" + search + "*";
|
||||
Set<String> groups;
|
||||
groups = getAuthorityService().findAuthorities(AuthorityType.GROUP, term);
|
||||
groups.addAll(getAuthorityService().getAllAuthorities(AuthorityType.EVERYONE));
|
||||
|
||||
results = new ArrayList<SelectItem>(groups.size());
|
||||
|
||||
int count = 0;
|
||||
String groupDisplayName;
|
||||
for (String group : groups)
|
||||
{
|
||||
// get display name, if not present strip prefix from group id
|
||||
groupDisplayName = getAuthorityService().getAuthorityDisplayName(group);
|
||||
if (groupDisplayName == null || groupDisplayName.length() == 0)
|
||||
{
|
||||
groupDisplayName = group.substring(PermissionService.GROUP_PREFIX.length());
|
||||
}
|
||||
|
||||
results.add(new SortableSelectItem(group, groupDisplayName, groupDisplayName));
|
||||
|
||||
if (++count == maxResults) break;
|
||||
}
|
||||
results = addGroupItems(search, maxResults);
|
||||
}
|
||||
|
||||
items = new SelectItem[results.size()];
|
||||
@@ -564,6 +542,40 @@ public abstract class BaseInviteUsersWizard extends BaseWizardBean
|
||||
return items;
|
||||
}
|
||||
|
||||
private List<SelectItem> addGroupItems(String search, int maxResults)
|
||||
{
|
||||
Set<String> groups = getGroups(search);
|
||||
|
||||
List<SelectItem> results = new ArrayList<SelectItem>(groups.size());
|
||||
|
||||
int count = 0;
|
||||
String groupDisplayName;
|
||||
for (String group : groups)
|
||||
{
|
||||
// get display name, if not present strip prefix from group id
|
||||
groupDisplayName = getAuthorityService().getAuthorityDisplayName(group);
|
||||
if (groupDisplayName == null || groupDisplayName.length() == 0)
|
||||
{
|
||||
groupDisplayName = group.substring(PermissionService.GROUP_PREFIX.length());
|
||||
}
|
||||
|
||||
results.add(new SortableSelectItem(group, groupDisplayName, groupDisplayName));
|
||||
|
||||
if (++count == maxResults) break;
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
protected Set<String> getGroups(String search)
|
||||
{
|
||||
// groups - text search match on supplied name
|
||||
String term = PermissionService.GROUP_PREFIX + "*" + search + "*";
|
||||
Set<String> groups;
|
||||
groups = getAuthorityService().findAuthorities(AuthorityType.GROUP, term);
|
||||
groups.addAll(getAuthorityService().getAllAuthorities(AuthorityType.EVERYONE));
|
||||
return groups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Action handler called when the Add button is pressed to process the current selection
|
||||
*/
|
||||
|
Reference in New Issue
Block a user