mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
MDL-43978 badges: Display error message to guest users viewing "My Badges" page
This commit is contained in:
parent
183515da23
commit
a2a114bd6a
@ -42,7 +42,14 @@ if (empty($CFG->enablebadges)) {
|
||||
print_error('badgesdisabled', 'badges');
|
||||
}
|
||||
|
||||
$url = new moodle_url('/badges/mybadges.php');
|
||||
$PAGE->set_url($url);
|
||||
|
||||
if (isguestuser()) {
|
||||
$PAGE->set_context(context_system::instance());
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->box(get_string('error:guestuseraccess', 'badges'), 'notifyproblem');
|
||||
echo $OUTPUT->footer();
|
||||
die();
|
||||
}
|
||||
|
||||
@ -80,9 +87,6 @@ if ($hide) {
|
||||
$context = context_user::instance($USER->id);
|
||||
require_capability('moodle/badges:manageownbadges', $context);
|
||||
|
||||
$url = new moodle_url('/badges/mybadges.php');
|
||||
|
||||
$PAGE->set_url($url);
|
||||
$PAGE->set_context($context);
|
||||
|
||||
$title = get_string('mybadges', 'badges');
|
||||
|
@ -223,6 +223,7 @@ $string['error:connectionunknownreason'] = 'The connection was unsuccessful but
|
||||
$string['error:clone'] = 'Cannot clone the badge.';
|
||||
$string['error:duplicatename'] = 'Badge with such name already exists in the system.';
|
||||
$string['error:externalbadgedoesntexist'] = 'Badge not found';
|
||||
$string['error:guestuseraccess'] = 'You are currently using guest access. To see badges you need to login with your user account.';
|
||||
$string['error:invalidbadgeurl'] = 'Invalid badge issuer URL format.';
|
||||
$string['error:invalidcriteriatype'] = 'Invalid criteria type.';
|
||||
$string['error:invalidexpiredate'] = 'Expiry date has to be in the future.';
|
||||
|
Loading…
x
Reference in New Issue
Block a user