]> git.mjollnir.org Git - moodle.git/commitdiff
Patch submitted by Ethem:
authorstronk7 <stronk7>
Sun, 3 Sep 2006 20:16:24 +0000 (20:16 +0000)
committerstronk7 <stronk7>
Sun, 3 Sep 2006 20:16:24 +0000 (20:16 +0000)
Error message isn't shown when user clicked without key.
Multienrol is enabled (course enrol key with authorize)

This patch allows showing error message when user clicked button without key.

enrol/authorize/enrol.php
enrol/manual/enrol.html

index d7986156f551b6a07d4cc0ec6fd6f6c1e35f0f19..a3a6a8b63a350891cce301571567fdd12c5fbedd 100755 (executable)
@@ -132,7 +132,7 @@ class enrolment_plugin_authorize
     {
         global $CFG;
 
-        if (zero_cost($course) || (!empty($course->password) && !empty($form->password))) {
+        if (zero_cost($course) || (!empty($course->password) && !empty($form->password) && $form->enrol == 'manual')) {
             $manual = enrolment_factory::factory('manual');
             $manual->check_entry($form, $course);
             if (!empty($manual->errormsg)) {
index b2f34aad2dfc441c95b796191b0834fe91f6a782..c3f563d45cbb73f12359d78fd132c5fe4104d81a 100644 (file)
@@ -20,6 +20,7 @@
             <td>
               <input type="password" name="password" size="20" value="<?php p($password) ?>"  />
               <input type="hidden" name="id" value="<?php p($course->id) ?>"  />
+              <input type="hidden" name="enrol" value="manual" />
               <input type="submit" value="<?php print_string("enrolme") ?>" />
             </td>
           </tr>