This commit is contained in:
Huong Nguyen 2024-05-30 09:30:03 +07:00
commit 5e7e6ad9b7
No known key found for this signature in database
GPG Key ID: 40D88AB693A3E72A
3 changed files with 11 additions and 6 deletions

View File

@ -298,11 +298,11 @@ class auth_plugin_shibboleth extends auth_plugin_base {
return $result;
}
$url = new moodle_url('/auth/shibboleth/index.php');
$context = \core\context\system::instance();
if ($config->auth_logo) {
$iconurl = moodle_url::make_pluginfile_url(
context_system::instance()->id,
$context->id,
'auth_shibboleth',
'logo',
null,
@ -312,7 +312,12 @@ class auth_plugin_shibboleth extends auth_plugin_base {
$iconurl = null;
}
$result[] = ['url' => $url, 'iconurl' => $iconurl, 'name' => $config->login_name];
$result[] = [
'url' => new moodle_url('/auth/shibboleth/index.php'),
'iconurl' => $iconurl,
'name' => format_string($config->login_name ?? '', options: ['context' => $context]),
];
return $result;
}
}

View File

@ -53,7 +53,7 @@
$loginsite = get_string("loginsite");
$PAGE->set_url('/auth/shibboleth/login.php');
$PAGE->set_context(context_system::instance());
$PAGE->set_context(\core\context\system::instance());
$PAGE->navbar->add($loginsite);
$PAGE->set_title($loginsite);
$PAGE->set_heading($site->fullname);
@ -110,7 +110,7 @@
'guestloginurl' => new moodle_url('/login/index.php'),
'idps' => $idps,
'instructions' => $instructions,
'loginname' => $config->login_name ?? null,
'loginname' => format_string($config->login_name ?? '', options: ['context' => $PAGE->context]),
'logintoken' => \core\session\manager::get_login_token(),
'loginurl' => new moodle_url('/auth/shibboleth/login.php'),
'showinstructions' => $showinstructions,

View File

@ -63,7 +63,7 @@ if ($ADMIN->fulltree) {
// Authentication method name.
$settings->add(new admin_setting_configtext('auth_shibboleth/login_name',
get_string('auth_shib_auth_method', 'auth_shibboleth'),
get_string('auth_shib_auth_method_description', 'auth_shibboleth'), 'Shibboleth Login', PARAM_RAW_TRIMMED));
get_string('auth_shib_auth_method_description', 'auth_shibboleth'), 'Shibboleth Login', PARAM_TEXT));
// Authentication method logo.
$settings->add(new admin_setting_configstoredfile('auth_shibboleth/auth_logo',