MDL-29011 do not require manual enrol cap on the enrolled users page
authorPetr Skoda <commits@skodak.org>
Sun, 21 Aug 2011 16:17:43 +0000 (18:17 +0200)
committerPetr Skoda <commits@skodak.org>
Sun, 21 Aug 2011 16:17:43 +0000 (18:17 +0200)
enrol/manual/lib.php

index f31e44f..206ee89 100644 (file)
@@ -198,7 +198,11 @@ class enrol_manual_plugin extends enrol_plugin {
             return false;
         }
 
-        $button = new enrol_user_button($this->get_manual_enrol_link($instance), get_string('enrolusers', 'enrol_manual'), 'get');
+        if (!$manuallink = $this->get_manual_enrol_link($instance)) {
+            return false;
+        }
+
+        $button = new enrol_user_button($manuallink, get_string('enrolusers', 'enrol_manual'), 'get');
         $button->class .= ' enrol_manual_plugin';
 
         $startdate = $manager->get_course()->startdate;