fixed sql to prevent link duplication and non multiprovider registration of same username
bug fix in get_course_max_level method
Merge branch 'upstream/master'
Merge branch 'master'