Minor improvements to IMS-E enrol - better handling of empty <userid></userid>

This commit is contained in:
danstowell 2006-04-06 14:06:40 +00:00
parent a488b9325c
commit 2201638882

View File

@ -526,8 +526,10 @@ function process_person_tag($tagcontents){
}
if(preg_match('{<userid>(.*?)</userid>}is', $tagcontents, $matches)){
$person->username = trim($matches[1]);
}elseif($CFG->enrol_imssourcedidfallback){
}
if($CFG->enrol_imssourcedidfallback && trim($person->username)==''){
// This is the point where we can fall back to useing the "sourcedid" if "userid" is not supplied
// NB We don't use an "elseif" because the tag may be supplied-but-empty
$person->username = $person->idnumber;
}
if(preg_match('{<email>(.*?)</email>}is', $tagcontents, $matches)){