Bug #5941 - Myriad of problems with Paypal enrollmemts, part 2 - Login as guest not shown to guests and there is login link instead of paypal button for guests; merged from MOODLE_16_STABLE

This commit is contained in:
skodak 2006-06-28 15:26:31 +00:00
parent 7c24284126
commit e87fe61524
2 changed files with 25 additions and 11 deletions

View file

@ -37,7 +37,7 @@
print_simple_box_end(); print_simple_box_end();
if ($course->guest) { if ($course->guest and !isguest()) {
print_simple_box_start('center'); print_simple_box_start('center');
?> ?>
<form name="form" method="post" action="enrol.php"> <form name="form" method="post" action="enrol.php">

View file

@ -39,11 +39,24 @@ function print_entry($course) {
print_course($course, "80%"); print_course($course, "80%");
if ($course->password) { // Presenting two options if ($course->password) { // Presenting two options
print_simple_box(get_string('costorkey', 'enrol_paypal'), 'center'); print_heading(get_string('costorkey', 'enrol_paypal'), 'center');
} }
print_simple_box_start("center"); print_simple_box_start("center");
if (isguest()) {
if (empty($CFG->loginhttps)) {
$wwwroot = $CFG->wwwroot;
} else {
// This actually is not so secure ;-), 'cause we're
// in unencrypted connection...
$wwwroot = str_replace("http://", "https://", $CFG->wwwroot);
}
echo '<div align="center"><p>'.get_string('paymentrequired').'</p>';
echo '<p><b>'.get_string('cost').": $CFG->enrol_currency $cost".'</b></p>';
echo '<p><a href="'.$wwwroot.'/login/">'.get_string('loginsite').'</a></p>';
echo '</div>';
} else {
//Sanitise some fields before building the PayPal form //Sanitise some fields before building the PayPal form
$coursefullname = $this->sanitise_for_paypal($course->fullname); $coursefullname = $this->sanitise_for_paypal($course->fullname);
$courseshortname = $this->sanitise_for_paypal($course->shortname); $courseshortname = $this->sanitise_for_paypal($course->shortname);
@ -54,6 +67,7 @@ function print_entry($course) {
$usercity = $this->sanitise_for_paypal($USER->city); $usercity = $this->sanitise_for_paypal($USER->city);
include($CFG->dirroot.'/enrol/paypal/enrol.html'); include($CFG->dirroot.'/enrol/paypal/enrol.html');
}
print_simple_box_end(); print_simple_box_end();