Skip to content
Snippets Groups Projects
Commit ea5b0ac7 authored by srosse's avatar srosse
Browse files

OO-4545: search by nick name too

parent 19bff2a0
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,7 @@ public class IdentityDAO {
.append(" where lower(ident.name) in (:names)")
.append(" or lower(auth.authusername) in (:names)")
.append(" or lower(concat(user.firstName,' ', user.lastName)) in (:names)")
.append(" or lower(user.nickName) in (:names)")
.append(" or lower(user.email) in (:names)")
.append(" or lower(user.institutionalEmail) in (:names)")
.append(" or lower(user.institutionalUserIdentifier) in (:names)");
......@@ -107,7 +108,7 @@ public class IdentityDAO {
return new ArrayList<>(namedIdentities.values());
}
private void appendName(FindNamedIdentity namedIdentity, Authentication authentication, Collection<String> names) {
private void appendName(FindNamedIdentity namedIdentity, Authentication authentication, Set<String> names) {
if(authentication != null) {
String authUsername = authentication.getAuthusername().toLowerCase();
if(names.contains(authUsername)) {
......@@ -149,6 +150,11 @@ public class IdentityDAO {
&& names.contains(user.getProperty(UserConstants.INSTITUTIONALUSERIDENTIFIER, null).toLowerCase())) {
namedIdentity.addName(user.getProperty(UserConstants.INSTITUTIONALUSERIDENTIFIER, null));
}
if(StringHelper.containsNonWhitespace(user.getProperty(UserConstants.NICKNAME, null))
&& names.contains(user.getProperty(UserConstants.NICKNAME, null).toLowerCase())) {
namedIdentity.addName(user.getProperty(UserConstants.NICKNAME, null));
}
}
public void setIdentityLastLogin(IdentityRef identity, Date lastLogin) {
......
......@@ -135,6 +135,8 @@ public class ImportMemberByUsernamesController extends StepFormBasicController {
tableEl.setCustomizeColumns(false);
tableEl.setMultiSelect(true);
tableEl.setSelectAllEnable(true);
tableEl.setCustomizeColumns(true);
tableEl.setAndLoadPersistedPreferences(ureq, "user-import-table-v1");
}
@Override
......
......@@ -1414,12 +1414,12 @@ public class LDAPLoginManagerImpl implements LDAPLoginManager, AuthenticationPro
currentMemberKeys.add(currentMember.getKey());
}
List<LDAPUser> coaches = new ArrayList<>(ldapGroup.getCoaches());
List<LDAPUser> participants = new ArrayList<>(ldapGroup.getParticipants());
Set<LDAPUser> coaches = new HashSet<>(ldapGroup.getCoaches());
Set<LDAPUser> participants = new HashSet<>(ldapGroup.getParticipants());
// transfer member cn's to the participants list
for(String member:ldapGroup.getMembers()) {
try {
LDAPUser ldapUser = getLDAPUser(ctx, member, dnToIdentityKeyMap, errors); dnToIdentityKeyMap.get(member);
LDAPUser ldapUser = getLDAPUser(ctx, member, dnToIdentityKeyMap, errors);
if(ldapUser != null && !participants.contains(ldapUser)) {
participants.add(ldapUser);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment