From 7b72a3704137a9bdf8b05a14653e77b28ed29470 Mon Sep 17 00:00:00 2001 From: Lai Wei Date: Wed, 12 Oct 2022 15:28:38 +0100 Subject: [PATCH] Fix section error in auth_oidc confirmation page for new installations --- auth/oidc/classes/form/application.php | 3 ++- auth/oidc/lang/en/auth_oidc.php | 1 - auth/oidc/manageapplication.php | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/auth/oidc/classes/form/application.php b/auth/oidc/classes/form/application.php index 77d24231d..85c06e84a 100644 --- a/auth/oidc/classes/form/application.php +++ b/auth/oidc/classes/form/application.php @@ -77,7 +77,8 @@ protected function definition() { $authmethodoptions = [ AUTH_OIDC_AUTH_METHOD_SECRET => get_string('auth_method_secret', 'auth_oidc'), ]; - if ($this->_customdata['oidcconfig']->idptype == AUTH_OIDC_IDP_TYPE_MICROSOFT) { + if (isset($this->_customdata['oidcconfig']->idptype) && + $this->_customdata['oidcconfig']->idptype == AUTH_OIDC_IDP_TYPE_MICROSOFT) { $authmethodoptions[AUTH_OIDC_AUTH_METHOD_CERTIFICATE] = get_string('auth_method_certificate', 'auth_oidc'); } $mform->addElement('select', 'clientauthmethod', auth_oidc_config_name_in_form('clientauthmethod'), $authmethodoptions); diff --git a/auth/oidc/lang/en/auth_oidc.php b/auth/oidc/lang/en/auth_oidc.php index 3504f977e..955774a3d 100644 --- a/auth/oidc/lang/en/auth_oidc.php +++ b/auth/oidc/lang/en/auth_oidc.php @@ -147,7 +147,6 @@
  • If Azure AD is used as the IdP, additional profile data can be made available by installing and configuring the Microsoft 365 integration plugin (local_o365).
  • If SDS profile sync feature is enabled in the local_o365 plugin, certain profile fields can be synchronised from SDS to Moodle. when running the "Sync with SDS" scheduled task, and will not happen when running the "Sync users with Azure AD" scheduled task, nor when user logs in.
  • '; -$string['error_incomplete_basic_settings'] = 'Missing basic settings.'; $string['settings_section_basic'] = 'Basic settings'; $string['settings_section_authentication'] = 'Authentication'; $string['settings_section_endpoints'] = 'Endpoints'; diff --git a/auth/oidc/manageapplication.php b/auth/oidc/manageapplication.php index 39d6a947e..0258df0aa 100644 --- a/auth/oidc/manageapplication.php +++ b/auth/oidc/manageapplication.php @@ -52,12 +52,6 @@ $oidcconfig = get_config('auth_oidc'); -// If "idptype" or "clientid" is not set, we are not ready to configure application authentication. -if (!isset($oidcconfig->idptype) || empty($oidcconfig->idptype) || !isset($oidcconfig->clientid) || empty($oidcconfig->clientid)) { - redirect(new moodle_url('/admin/settings.php', ['section' => 'auth_oidc_basic_settings']), - get_string('error_incomplete_basic_settings', 'auth_oidc')); -} - $form = new application(null, ['oidcconfig' => $oidcconfig]); $formdata = [];