Permalink
Browse files

isguest() to has_capability('moodle/legacy:guest', get_context_instan…

…ce(CONTEXT_SYSTEM, SITEID), $USER->id, false)
  • Loading branch information...
1 parent 65e2d1f commit f0f8e34c5d3ed2290801b5ba19902e76a1ad0765 ethem committed Sep 22, 2006
Showing with 4 additions and 4 deletions.
  1. +3 −3 enrol/authorize/enrol.php
  2. +1 −1 enrol/authorize/index.php
@@ -45,6 +45,8 @@ function print_entry($course) {
return;
}
+ httpsrequired();
+
if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') {
if (empty($CFG->loginhttps)) {
error(get_string('httpsrequired', 'enrol_authorize'));
@@ -55,8 +57,6 @@ function print_entry($course) {
}
}
- httpsrequired();
-
$strcourses = get_string('courses');
$strloginto = get_string('loginto', '', $course->shortname);
@@ -70,7 +70,7 @@ function print_entry($course) {
}
print_simple_box_start('center');
- if (isguest()) {
+ if (has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM, SITEID), $USER->id, false)) {
$curcost = get_course_cost($course);
echo '<div align="center">';
echo '<p>'.get_string('paymentrequired').'</p>';
@@ -12,7 +12,7 @@
/// Only site users can access to this page
require_login(); // Don't use $courseid! User may want to see old orders.
- if (isguest()) {
+ if (has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM, SITEID), $USER->id, false)) {
error("Guests cannot use this page.");
}

0 comments on commit f0f8e34

Please sign in to comment.