From: danstowell Date: Thu, 6 Apr 2006 14:06:40 +0000 (+0000) Subject: Minor improvements to IMS-E enrol - better handling of empty X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=220163888274021d57d8afe2893e16c416ce4345;p=moodle.git Minor improvements to IMS-E enrol - better handling of empty --- diff --git a/enrol/imsenterprise/enrol.php b/enrol/imsenterprise/enrol.php index 06f24d5196..d32ba81bdf 100644 --- a/enrol/imsenterprise/enrol.php +++ b/enrol/imsenterprise/enrol.php @@ -526,8 +526,10 @@ function process_person_tag($tagcontents){ } if(preg_match('{(.*?)}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('{(.*?)}is', $tagcontents, $matches)){