From 0b80aaf2178e5a40f9429ce972c490f6067ef114 Mon Sep 17 00:00:00 2001 From: Joseph Warner Date: Fri, 9 Aug 2013 05:16:39 -0400 Subject: [PATCH] [feature/oauth] Add method to return necessary data for auth_link PHPBB3-11673 --- phpBB/includes/ucp/ucp_auth_link.php | 11 ++++++++++- phpBB/phpbb/auth/provider/base.php | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/ucp/ucp_auth_link.php b/phpBB/includes/ucp/ucp_auth_link.php index 6bf74d4fbf..c1d97c8cf8 100644 --- a/phpBB/includes/ucp/ucp_auth_link.php +++ b/phpBB/includes/ucp/ucp_auth_link.php @@ -21,7 +21,16 @@ class ucp_auth_link public function main($id, $mode) { - global $template, $phpbb_container; + global $config, $request, $template, $phpbb_container; + + $auth_provider = $phpbb_container->get('auth.provider.' . $config['auth_method']); + + // confirm that the auth provider supports this page + $provider_data = $auth_provider->get_auth_link_data(); + if ($provider_data === null) + { + // does not support this page, throw error? + } $error = array(); $s_hidden_fields = array(); diff --git a/phpBB/phpbb/auth/provider/base.php b/phpBB/phpbb/auth/provider/base.php index ae1daba82b..2f1bf8f601 100644 --- a/phpBB/phpbb/auth/provider/base.php +++ b/phpBB/phpbb/auth/provider/base.php @@ -62,6 +62,14 @@ abstract class phpbb_auth_provider_base implements phpbb_auth_provider_interface return; } + /** + * {@inheritdoc} + */ + public function get_auth_link_data() + { + return; + } + /** * {@inheritdoc} */