Permalink
Browse files

Multienrol FIX: Move error message from this to manual plugin to show…

… error message. This plugin is never inherited anymore. Each time, we create new manual_plugin() and this causes hiding error message.
  • Loading branch information...
1 parent 0ea68a9 commit e5cf77cd19439f7cddf1ef7e940fe4b0b6211f41 ethem committed Jun 28, 2006
Showing with 8 additions and 1 deletion.
  1. +8 −1 enrol/authorize/enrol.php
@@ -51,7 +51,8 @@ class enrolment_plugin_authorize
* @var array
* @access public
*/
- var $ccerrors = array();
+ var $ccerrors = array(); // for this plugin
+ var $errormsg; // for manual plugin
/**
* Cron log.
@@ -74,6 +75,9 @@ function print_entry($course)
if ($this->zero_cost($course) or isguest()) {
$manual = enrolment_factory::factory('manual');
+ if (!empty($this->errormsg)) { // move to manual to allow showing error message
+ $manual->errormsg = $this->errormsg;
+ }
$manual->print_entry($course);
return; // No money for guests ;)
}
@@ -122,6 +126,9 @@ function check_entry($form, $course) {
if ((!empty($form->password)) or isguest() or $this->zero_cost($course)) {
$manual = enrolment_factory::factory('manual');
$manual->check_entry($form, $course);
+ if (!empty($manual->errormsg)) { // to show error message in $this->print_entry()
+ $this->errormsg = $manual->errormsg;
+ }
} elseif ((!empty($form->ccsubmit)) and $this->validate_enrol_form($form)) {
$this->cc_submit($form, $course);
}

0 comments on commit e5cf77c

Please sign in to comment.