From: ethem Date: Thu, 29 Jun 2006 19:07:28 +0000 (+0000) Subject: Merged from MOODLE_16_STABLE. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=11fffc6059df96c24f98041c44fc0ebd934a9f5e;p=moodle.git Merged from MOODLE_16_STABLE. --- diff --git a/enrol/authorize/enrol.html b/enrol/authorize/enrol.html index 5dabac7544..5dcc2267e6 100755 --- a/enrol/authorize/enrol.html +++ b/enrol/authorize/enrol.html @@ -1,5 +1,6 @@ prevent_double_paid($course); $formvars = array('password', 'ccaddress', 'cccity', 'ccstate', 'cccountry', 'cczip', 'ccfirstname', 'cclastname', 'cc', 'ccexpiremm', 'ccexpireyyyy', 'cctype', 'cvv'); diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index 0eb9a38ac6..545b66d6e3 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -100,6 +100,16 @@ class enrolment_plugin_authorize function print_entry($course) { global $CFG, $USER, $form; + $zerocost = $this->zero_cost($course); + if ($zerocost) { + $manual = enrolment_factory::factory('manual'); + if (!empty($this->errormsg)) { + $manual->errormsg = $this->errormsg; + } + $manual->print_entry($course); + return; + } + httpsrequired(); if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') { @@ -114,31 +124,26 @@ class enrolment_plugin_authorize $strcourses = get_string('courses'); $strloginto = get_string('loginto', '', $course->shortname); - $zerocost = $this->zero_cost($course); print_header($strloginto, $course->fullname, "wwwroot/course/\">$strcourses -> $strloginto"); print_course($course, '80%'); - if ($course->password && !$zerocost) { + if ($course->password) { print_heading(get_string('choosemethod', 'enrol_authorize'), 'center'); } - print_simple_box_start('center'); - if ($zerocost){ - echo '

'.get_string('nocostyet', 'enrol_authorize').'

'; - } else if (isguest()) { + if (isguest()) { $curcost = $this->get_course_cost($course); echo '

'.get_string('paymentrequired').'

'; echo '

'.get_string('cost').": $curcost[currency] $curcost[cost]".'

'; echo '

'.get_string('loginsite').'

'; echo '
'; } else { - $this->prevent_double_paid($course); + print_simple_box_start('center'); include($CFG->dirroot.'/enrol/authorize/enrol.html'); + print_simple_box_end(); } - print_simple_box_end(); - if ($course->password) { $password = ''; $teacher = get_teacher($course->id); @@ -157,10 +162,10 @@ class enrolment_plugin_authorize * @access public */ function check_entry($form, $course) { - if (!empty($course->password) and !empty($form->password)) { + if ($this->zero_cost($course) or (!empty($course->password) and !empty($form->password))) { $manual = enrolment_factory::factory('manual'); $manual->check_entry($form, $course); - if (isset($manual->errormsg)) { + if (!empty($manual->errormsg)) { $this->errormsg = $manual->errormsg; } } elseif ((!empty($form->ccsubmit)) and $this->validate_enrol_form($form)) {