diff --git a/auth/shibboleth/auth.php b/auth/shibboleth/auth.php index f2a57a99f19..0c168e12fff 100644 --- a/auth/shibboleth/auth.php +++ b/auth/shibboleth/auth.php @@ -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; } } diff --git a/auth/shibboleth/login.php b/auth/shibboleth/login.php index df23826ed22..6ecad18fbd7 100644 --- a/auth/shibboleth/login.php +++ b/auth/shibboleth/login.php @@ -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, diff --git a/auth/shibboleth/settings.php b/auth/shibboleth/settings.php index 7c2117ec824..d6a9d43a3c1 100644 --- a/auth/shibboleth/settings.php +++ b/auth/shibboleth/settings.php @@ -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',