Skip to content
Browse files

Bug #5941, Petr's patch is incorrect. Rewritten.

If course cost is 0 then fall back manual method.
  • Loading branch information...
1 parent e8b5984 commit ec4fda2d3d71d82ceb016de1851dd2ddd5e44605 ethem committed Jun 29, 2006
Showing with 12 additions and 9 deletions.
  1. +1 −0 enrol/authorize/enrol.html
  2. +11 −9 enrol/authorize/enrol.php
View
1 enrol/authorize/enrol.html
@@ -1,5 +1,6 @@
<?php // $Id$
+$this->prevent_double_paid($course);
$formvars = array('password', 'ccaddress', 'cccity', 'ccstate', 'cccountry', 'cczip',
'ccfirstname', 'cclastname', 'cc', 'ccexpiremm', 'ccexpireyyyy', 'cctype', 'cvv');
View
20 enrol/authorize/enrol.php
@@ -112,33 +112,35 @@ function print_entry($course) {
}
}
+ $zerocost = $this->zero_cost($course);
+ if ($zerocost) {
+ $manual = enrolment_factory::factory('manual');
+ $manual->print_entry($course);
+ return;
+ }
+
$strcourses = get_string('courses');
$strloginto = get_string('loginto', '', $course->shortname);
- $zerocost = $this->zero_cost($course);
print_header($strloginto, $course->fullname, "<a href=\"$CFG->wwwroot/course/\">$strcourses</a> -> $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 '<div align="center"><p>'.get_string('nocostyet', 'enrol_authorize').'</p></div>';
- } else if (isguest()) {
+ if (isguest()) {
$curcost = $this->get_course_cost($course);
echo '<div align="center"><p>'.get_string('paymentrequired').'</p>';
echo '<p><b>'.get_string('cost').": $curcost[currency] $curcost[cost]".'</b></p>';
echo '<p><a href="'.$CFG->httpswwwroot.'/login/">'.get_string('loginsite').'</a></p>';
echo '</div>';
} 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);

0 comments on commit ec4fda2

Please sign in to comment.
Something went wrong with that request. Please try again.