mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
isguest() to has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM, SITEID), $USER->id, false)
This commit is contained in:
parent
65e2d1f0df
commit
f0f8e34c5d
2 changed files with 4 additions and 4 deletions
|
@ -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 '<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.");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue