From f179253ab701f6846e818ca399d9c528ec8b73bd Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Fri, 25 Oct 2019 12:42:47 +0100 Subject: [PATCH] MDL-59303 auth_shibboleth: consistent readme URL. --- auth/shibboleth/auth.php | 3 ++- auth/shibboleth/index.php | 5 +++-- auth/shibboleth/lang/en/auth_shibboleth.php | 6 +++--- auth/shibboleth/settings.php | 5 +++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/auth/shibboleth/auth.php b/auth/shibboleth/auth.php index ad0c55fbdeef4..8bedda9d34cc8 100644 --- a/auth/shibboleth/auth.php +++ b/auth/shibboleth/auth.php @@ -263,7 +263,8 @@ public function test_settings() { global $OUTPUT; if (!isset($this->config->user_attribute) || empty($this->config->user_attribute)) { - echo $OUTPUT->notification(get_string("shib_not_set_up_error", "auth_shibboleth"), 'notifyproblem'); + echo $OUTPUT->notification(get_string("shib_not_set_up_error", "auth_shibboleth", + (new moodle_url('/auth/shibboleth/README.txt'))->out()), 'notifyproblem'); return; } if ($this->config->convert_data and $this->config->convert_data != '' and !is_readable($this->config->convert_data)) { diff --git a/auth/shibboleth/index.php b/auth/shibboleth/index.php index b177f7c9b6233..0e0752c12cca9 100644 --- a/auth/shibboleth/index.php +++ b/auth/shibboleth/index.php @@ -32,8 +32,9 @@ $shibbolethauth = get_auth_plugin('shibboleth'); // Check whether Shibboleth is configured properly + $readmeurl = (new moodle_url('/auth/shibboleth/README.txt'))->out(); if (empty($pluginconfig->user_attribute)) { - print_error('shib_not_set_up_error', 'auth_shibboleth'); + print_error('shib_not_set_up_error', 'auth_shibboleth', '', $readmeurl); } /// If we can find the Shibboleth attribute, save it in session and return to main login page @@ -91,7 +92,7 @@ elseif (!empty($_SERVER['HTTP_SHIB_APPLICATION_ID']) || !empty($_SERVER['Shib-Application-ID'])) { print_error('shib_no_attributes_error', 'auth_shibboleth' , '', '\''.$pluginconfig->user_attribute.'\', \''.$pluginconfig->field_map_firstname.'\', \''.$pluginconfig->field_map_lastname.'\' and \''.$pluginconfig->field_map_email.'\''); } else { - print_error('shib_not_set_up_error', 'auth_shibboleth'); + print_error('shib_not_set_up_error', 'auth_shibboleth', '', $readmeurl); } diff --git a/auth/shibboleth/lang/en/auth_shibboleth.php b/auth/shibboleth/lang/en/auth_shibboleth.php index bff026732d56e..ca9b65b81ad5e 100644 --- a/auth/shibboleth/lang/en/auth_shibboleth.php +++ b/auth/shibboleth/lang/en/auth_shibboleth.php @@ -28,7 +28,7 @@ $string['auth_shib_auth_logo'] = 'Authentication method logo'; $string['auth_shib_auth_logo_description'] = 'Provide a logo for the Shibboleth authentication method that is familiar to your users. This could be the logo of your Shibboleth federation, e.g. SWITCHaai Login or InCommon Login or similar.'; $string['auth_shib_contact_administrator'] = 'In case you are not associated with the given organizations and you need access to a course on this server, please contact the Moodle Administrator.'; -$string['auth_shibbolethdescription'] = 'Using this method users are created and authenticated using Shibboleth. For set-up details, see the Shibboleth README.'; +$string['auth_shibbolethdescription'] = 'Using this method users are created and authenticated using Shibboleth. For set-up details, see the Shibboleth README.'; $string['auth_shibboleth_errormsg'] = 'Please select the organization you are member of!'; $string['auth_shibboleth_login'] = 'Shibboleth login'; $string['auth_shibboleth_login_long'] = 'Login to Moodle via Shibboleth'; @@ -36,7 +36,7 @@ $string['auth_shibboleth_select_member'] = 'I\'m a member of ...'; $string['auth_shibboleth_select_organization'] = 'For authentication via Shibboleth, please select your organisation from the drop-down menu:'; $string['auth_shib_convert_data'] = 'Data modification API'; -$string['auth_shib_convert_data_description'] = 'You can use this API to further modify the data provided by Shibboleth. Read the README for further instructions.'; +$string['auth_shib_convert_data_description'] = 'You can use this API to further modify the data provided by Shibboleth. Read the README for further instructions.'; $string['auth_shib_convert_data_warning'] = 'The file does not exist or is not readable by the webserver process!'; $string['auth_shib_changepasswordurl'] = 'Password-change URL'; $string['auth_shib_idp_list'] = 'Identity providers'; @@ -57,6 +57,6 @@ $string['shib_invalid_account_error'] = 'You seem to be Shibboleth authenticated but Moodle has no valid account for your username. Your account may not exist or it may have been suspended.'; $string['shib_no_attributes_error'] = 'You seem to be Shibboleth authenticated but Moodle didn\'t receive any user attributes. Please check that your Identity Provider releases the necessary attributes ({$a}) to the Service Provider Moodle is running on or inform the webmaster of this server.'; $string['shib_not_all_attributes_error'] = 'Moodle needs certain Shibboleth attributes which are not present in your case. The attributes are: {$a}
Please contact the webmaster of this server or your Identity Provider.'; -$string['shib_not_set_up_error'] = 'Shibboleth authentication doesn\'t seem to be set up correctly because no Shibboleth environment variables are present for this page. Please consult the README for further instructions on how to set up Shibboleth authentication or contact the webmaster of this Moodle installation.'; +$string['shib_not_set_up_error'] = 'Shibboleth authentication doesn\'t seem to be set up correctly because no Shibboleth environment variables are present for this page. Please consult the README for further instructions on how to set up Shibboleth authentication or contact the webmaster of this Moodle installation.'; $string['pluginname'] = 'Shibboleth'; $string['privacy:metadata'] = 'The Shibboleth authentication plugin does not store any personal data.'; diff --git a/auth/shibboleth/settings.php b/auth/shibboleth/settings.php index e4b4c3a9f860a..86dce35a92793 100644 --- a/auth/shibboleth/settings.php +++ b/auth/shibboleth/settings.php @@ -30,8 +30,9 @@ require_once($CFG->dirroot.'/auth/shibboleth/classes/admin_setting_special_idp_configtextarea.php'); // Introductory explanation. + $readmeurl = (new moodle_url('/auth/shibboleth/README.txt'))->out(); $settings->add(new admin_setting_heading('auth_shibboleth/pluginname', '', - new lang_string('auth_shibbolethdescription', 'auth_shibboleth'))); + new lang_string('auth_shibbolethdescription', 'auth_shibboleth', $readmeurl))); // Username. $settings->add(new admin_setting_configtext('auth_shibboleth/user_attribute', get_string('username'), @@ -40,7 +41,7 @@ // COnvert Data configuration file. $settings->add(new admin_setting_configfile('auth_shibboleth/convert_data', get_string('auth_shib_convert_data', 'auth_shibboleth'), - get_string('auth_shib_convert_data_description', 'auth_shibboleth'), '')); + get_string('auth_shib_convert_data_description', 'auth_shibboleth', $readmeurl), '')); // WAYF. $settings->add(new auth_shibboleth_admin_setting_special_wayf_select());