mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/13248] Always use provider collection for getting provider
PHPBB3-13248
This commit is contained in:
parent
c3f5dc75be
commit
a9249bce5e
3 changed files with 8 additions and 7 deletions
|
@ -34,11 +34,12 @@ class ucp_auth_link
|
||||||
*/
|
*/
|
||||||
public function main($id, $mode)
|
public function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $request, $template, $phpbb_container, $user;
|
global $request, $template, $phpbb_container, $user;
|
||||||
|
|
||||||
$error = array();
|
$error = array();
|
||||||
|
|
||||||
$auth_provider = $phpbb_container->get('auth.provider.' . $config['auth_method']);
|
$provider_collection = $phpbb_container->get('auth.provider_collection');
|
||||||
|
$auth_provider = $provider_collection->get_provider();
|
||||||
|
|
||||||
// confirm that the auth provider supports this page
|
// confirm that the auth provider supports this page
|
||||||
$provider_data = $auth_provider->get_auth_link_data();
|
$provider_data = $auth_provider->get_auth_link_data();
|
||||||
|
|
|
@ -39,7 +39,7 @@ class ucp_login_link
|
||||||
*/
|
*/
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $phpbb_container, $request, $template, $user;
|
global $phpbb_container, $request, $template, $user;
|
||||||
global $phpbb_root_path, $phpEx;
|
global $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
// Initialize necessary variables
|
// Initialize necessary variables
|
||||||
|
@ -57,8 +57,8 @@ class ucp_login_link
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the auth_provider requested even if different from configured
|
// Use the auth_provider requested even if different from configured
|
||||||
$auth_provider = 'auth.provider.' . $request->variable('auth_provider', $config['auth_method']);
|
$provider_collection = $phpbb_container->get('auth.provider_collection');
|
||||||
$auth_provider = $phpbb_container->get($auth_provider);
|
$auth_provider = $provider_collection->get_provider($request->variable('auth_provider', ''));
|
||||||
|
|
||||||
// Set the link_method to login_link
|
// Set the link_method to login_link
|
||||||
$data['link_method'] = 'login_link';
|
$data['link_method'] = 'login_link';
|
||||||
|
|
|
@ -87,8 +87,8 @@ class ucp_register
|
||||||
if (!empty($login_link_data))
|
if (!empty($login_link_data))
|
||||||
{
|
{
|
||||||
// Confirm that we have all necessary data
|
// Confirm that we have all necessary data
|
||||||
$auth_provider = 'auth.provider.' . $request->variable('auth_provider', $config['auth_method']);
|
$provider_collection = $phpbb_container->get('auth.provider_collection');
|
||||||
$auth_provider = $phpbb_container->get($auth_provider);
|
$auth_provider = $provider_collection->get_provider($request->variable('auth_provider', ''));
|
||||||
|
|
||||||
$result = $auth_provider->login_link_has_necessary_data($login_link_data);
|
$result = $auth_provider->login_link_has_necessary_data($login_link_data);
|
||||||
if ($result !== null)
|
if ($result !== null)
|
||||||
|
|
Loading…
Add table
Reference in a new issue