From f0f8e34c5d3ed2290801b5ba19902e76a1ad0765 Mon Sep 17 00:00:00 2001 From: ethem Date: Fri, 22 Sep 2006 15:31:04 +0000 Subject: [PATCH] isguest() to has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM, SITEID), $USER->id, false) --- enrol/authorize/enrol.php | 6 +++--- enrol/authorize/index.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index 1d95f531d3..04edb2ec2c 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -45,6 +45,8 @@ class enrolment_plugin_authorize return; } + httpsrequired(); + if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') { if (empty($CFG->loginhttps)) { error(get_string('httpsrequired', 'enrol_authorize')); @@ -55,8 +57,6 @@ class enrolment_plugin_authorize } } - httpsrequired(); - $strcourses = get_string('courses'); $strloginto = get_string('loginto', '', $course->shortname); @@ -70,7 +70,7 @@ class enrolment_plugin_authorize } 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 '
'; echo '

'.get_string('paymentrequired').'

'; diff --git a/enrol/authorize/index.php b/enrol/authorize/index.php index 894e3315be..e806e656f6 100644 --- a/enrol/authorize/index.php +++ b/enrol/authorize/index.php @@ -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."); } -- 2.39.5