From 6bb919860b9b8df0dee617a18bd24d2412efb54e Mon Sep 17 00:00:00 2001 From: stronk7 Date: Thu, 27 Sep 2007 23:37:42 +0000 Subject: [PATCH] Passing $course to require_login() provides correct and automatic navlinks to the course. MDL-11452 --- course/user.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/course/user.php b/course/user.php index 63d9432f7..a28f487db 100644 --- a/course/user.php +++ b/course/user.php @@ -13,8 +13,6 @@ $page = optional_param('page', 0, PARAM_INT); $perpage = optional_param('perpage', 100, PARAM_INT); - require_login(); - if (! $course = get_record("course", "id", $id)) { error("Course id is incorrect."); } @@ -23,6 +21,8 @@ error("User ID is incorrect"); } + require_login($course); + $coursecontext = get_context_instance(CONTEXT_COURSE, $id); $personalcontext = get_context_instance(CONTEXT_USER, $user->id); @@ -43,7 +43,6 @@ $fullname = fullname($user, true); $navlinks = array(); - $navlinks[] = array('name' => $course->shortname, 'link' => "course/view.php?id=$course->id", 'type' => 'misc'); if ($course->id != SITEID) { $navlinks[] = array('name' => $strparticipants, 'link' => "../user/index.php?id=$course->id", 'type' => 'misc'); -- 2.11.4.GIT