]> git.mjollnir.org Git - moodle.git/commitdiff
Hide "Unenrol" when we're not in a course
authormoodler <moodler>
Sat, 31 Jul 2004 13:02:06 +0000 (13:02 +0000)
committermoodler <moodler>
Sat, 31 Jul 2004 13:02:06 +0000 (13:02 +0000)
lib/weblib.php

index 863a82cd9ddf00ef0e6c49af4c71b38fcf9221e8..0fb1dfb3613066705253d5dafd839bfedbd4b613 100644 (file)
@@ -1400,7 +1400,7 @@ function print_user($user, $course) {
         $timemidnight = usergetmidnight(time());
         echo "<a href=\"$CFG->wwwroot/course/user.php?id=$course->id&user=$user->id\">$string->activity</a><br>";
         if (!iscreator($user->id)) {  // Includes admins
-            if (isteacheredit($course->id) and isstudent($course->id, $user->id)) {  // Includes admins
+            if ($course->category and isteacheredit($course->id) and isstudent($course->id, $user->id)) {  // Includes admins
                 echo "<a href=\"$CFG->wwwroot/course/unenrol.php?id=$course->id&user=$user->id\">$string->unenrol</a><br />";
             }
             if ($USER->id != $user->id) {