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

OO-852: strictly match the identifier and don't use standard search with like

parent c539551e
No related branches found
No related tags found
No related merge requests found
...@@ -47,6 +47,7 @@ import org.olat.course.assessment.model.BulkAssessmentDatas; ...@@ -47,6 +47,7 @@ import org.olat.course.assessment.model.BulkAssessmentDatas;
import org.olat.course.assessment.model.BulkAssessmentRow; import org.olat.course.assessment.model.BulkAssessmentRow;
import org.olat.course.assessment.model.BulkAssessmentSettings; import org.olat.course.assessment.model.BulkAssessmentSettings;
import org.olat.course.nodes.AssessableCourseNode; import org.olat.course.nodes.AssessableCourseNode;
import org.olat.user.UserManager;
/** /**
* *
...@@ -58,17 +59,18 @@ public class ValidationStepForm extends StepFormBasicController { ...@@ -58,17 +59,18 @@ public class ValidationStepForm extends StepFormBasicController {
private static final String[] userPropsToSearch = new String[]{ UserConstants.EMAIL, UserConstants.INSTITUTIONALEMAIL, UserConstants.INSTITUTIONALUSERIDENTIFIER }; private static final String[] userPropsToSearch = new String[]{ UserConstants.EMAIL, UserConstants.INSTITUTIONALEMAIL, UserConstants.INSTITUTIONALUSERIDENTIFIER };
private ValidDataModel validModel; private ValidDataModel validModel;
private ValidDataModel invalidModel; private ValidDataModel invalidModel;
private FlexiTableElement validTableEl; private FlexiTableElement validTableEl;
private FlexiTableElement invalidTableEl; private FlexiTableElement invalidTableEl;
private final UserManager userManager;
private final BaseSecurity securityManager; private final BaseSecurity securityManager;
public ValidationStepForm(UserRequest ureq, WindowControl wControl, StepsRunContext runContext, Form rootForm) { public ValidationStepForm(UserRequest ureq, WindowControl wControl, StepsRunContext runContext, Form rootForm) {
super(ureq, wControl, rootForm, runContext, LAYOUT_CUSTOM, "validation"); super(ureq, wControl, rootForm, runContext, LAYOUT_CUSTOM, "validation");
userManager = CoreSpringFactory.getImpl(UserManager.class);
securityManager = CoreSpringFactory.getImpl(BaseSecurity.class); securityManager = CoreSpringFactory.getImpl(BaseSecurity.class);
initForm(ureq); initForm(ureq);
doValidate(); doValidate();
...@@ -150,16 +152,13 @@ public class ValidationStepForm extends StepFormBasicController { ...@@ -150,16 +152,13 @@ public class ValidationStepForm extends StepFormBasicController {
continue; continue;
} }
Map<String, String> userProperties = new HashMap<String,String>();
for(String prop : userPropsToSearch) { for(String prop : userPropsToSearch) {
userProperties.put(prop, assessedId); identity = userManager.findIdentityKeyWithProperty(prop, assessedId);
List<Identity> identities = securityManager.getIdentitiesByPowerSearch(null, userProperties, false, null, null, null, null, null, null, null, null); if(identity != null) {
if(!identities.isEmpty()) { idToIdentityMap.put(assessedId, identity);
idToIdentityMap.put(assessedId, identities.get(0)); continue;
break;
} }
userProperties.clear(); }
}
} }
return idToIdentityMap; return idToIdentityMap;
......
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