]> git.mjollnir.org Git - moodle.git/commitdiff
Minor improvements to IMS-E enrol - better handling of empty <userid></userid>
authordanstowell <danstowell>
Thu, 6 Apr 2006 14:06:40 +0000 (14:06 +0000)
committerdanstowell <danstowell>
Thu, 6 Apr 2006 14:06:40 +0000 (14:06 +0000)
enrol/imsenterprise/enrol.php

index 06f24d51966f8eb55d5b40dd2a0f4daa35a311fb..d32ba81bdf10f2cc0f9494a166f189a20a1ff884 100644 (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)){