From 8e8622f12d0c5e48fccc2fd1b51839ca73389a47 Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Tue, 28 Dec 2021 11:48:00 +0100 Subject: [PATCH] `social_login_config::getSupportedConfiguredProviderConfigs()` is a better name than `\social_login_config::getValidConfiguredProviderConfigs()` because the method does not validate the provider configs. --- e107_core/controllers/system/xup.php | 2 +- e107_core/shortcodes/batch/signup_shortcodes.php | 2 +- e107_handlers/user_handler.php | 4 ++-- e107_plugins/social/includes/social_login_config.php | 9 ++++++++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/e107_core/controllers/system/xup.php b/e107_core/controllers/system/xup.php index 4e7943350..7b97484c0 100644 --- a/e107_core/controllers/system/xup.php +++ b/e107_core/controllers/system/xup.php @@ -105,7 +105,7 @@ class core_system_xup_controller extends eController $testUrl = SITEURL."?route=system/xup/test"; - $providers = $manager->getValidConfiguredProviderConfigs(); + $providers = $manager->getSupportedConfiguredProviderConfigs(); foreach($providers as $key=>$var) { diff --git a/e107_core/shortcodes/batch/signup_shortcodes.php b/e107_core/shortcodes/batch/signup_shortcodes.php index 20e05a01f..7edeb057f 100755 --- a/e107_core/shortcodes/batch/signup_shortcodes.php +++ b/e107_core/shortcodes/batch/signup_shortcodes.php @@ -125,7 +125,7 @@ class signup_shortcodes extends e_shortcode $manager = new social_login_config(e107::getConfig()); - $providers = $manager->getValidConfiguredProviderConfigs(); + $providers = $manager->getSupportedConfiguredProviderConfigs(); foreach ($providers as $p => $v) { diff --git a/e107_handlers/user_handler.php b/e107_handlers/user_handler.php index aaaeec9e2..3b9e2a043 100644 --- a/e107_handlers/user_handler.php +++ b/e107_handlers/user_handler.php @@ -1144,8 +1144,8 @@ class e_user_provider else { $this->_config = array( - "callback" => $this->generateCallbackUrl($provider), - "providers" => $this->social_login_config_manager->getValidConfiguredProviderConfigs(), + "callback" => $this->generateCallbackUrl($provider), + "providers" => $this->social_login_config_manager->getSupportedConfiguredProviderConfigs(), "debug_mode" => 'error', "debug_file" => e_LOG . "hybridAuth.log" ); diff --git a/e107_plugins/social/includes/social_login_config.php b/e107_plugins/social/includes/social_login_config.php index 6a5b7462f..bd8b4aa3d 100644 --- a/e107_plugins/social/includes/social_login_config.php +++ b/e107_plugins/social/includes/social_login_config.php @@ -162,9 +162,13 @@ class social_login_config /** * Get configs of providers that are supported and configured + * + * These configs are not validated here by the social login implementation. + * This method only filters out providers that are not supported and not configured. + * * @return array Associative array where the key is the denormalized provider name and the value is its config */ - public function getValidConfiguredProviderConfigs() + public function getSupportedConfiguredProviderConfigs() { $supported_providers = $this->getSupportedProviders(); $configured_providers = $this->getConfiguredProviders(); @@ -233,6 +237,9 @@ class social_login_config return $output; } + /** + * @return array + */ protected function getSocialLoginConfig() { $config = $this->config->get(self::SOCIAL_LOGIN_PREF);