Git commits in Moodle 3.1.8 by Jake Dallimore

commit 68b925e2745cc81d29150206fb4b6793b5d1cae8
Author: Jake Dallimore <jake@moodle.com>
Date:   Tue, 29 Aug 2017 10:45:25 +0800
Tag:    v3.1.8

MDL-58953 user: additional test case for user_can_view_profile()

commit 0a8190569f8d124b44e49253781aca369f01af6d
Author: Jake Dallimore <jake@moodle.com>
Date:   Tue, 29 Aug 2017 10:45:12 +0800
Tag:    v3.1.8

MDL-58953 user: fix course checking logic in user_can_view_profile()