moodlelib: require_login() - rework course/category visibility checks
commit1cf2e21b6e0816ddba2b59fa96d7ba178cf63117
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:19:20 +0000 (19 07:19 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:19:20 +0000 (19 07:19 +0000)
tree47b176f7cfe258a2592a62a17bab10eee5e85c49
parent3511647c443294e0c5b54d813e563d64c4ff29b0
moodlelib: require_login() - rework course/category visibility checks

Reworked the logic of the visibility checks so that we evaluate in a
chain:

   - can view course   (visible or user can see hidden)
   - can view category (visible or user can see hidden)

Without this patch, users that could see hidden categories could not get
into courses inside of them.

While at it, fix reference to the old $USER->switchrole
lib/moodlelib.php