mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 06:38:52 +00:00
[ticket/13564] Allow to specify user id for retrieving auth link data
PHPBB3-13564
This commit is contained in:
parent
3d0153de60
commit
ca883f1196
3 changed files with 8 additions and 4 deletions
|
@ -61,7 +61,7 @@ abstract class base implements \phpbb\auth\provider\provider_interface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_auth_link_data()
|
||||
public function get_auth_link_data($user_id = 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -553,13 +553,13 @@ class oauth extends \phpbb\auth\provider\base
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_auth_link_data()
|
||||
public function get_auth_link_data($user_id = 0)
|
||||
{
|
||||
$block_vars = array();
|
||||
|
||||
// Get all external accounts tied to the current user
|
||||
$data = array(
|
||||
'user_id' => (int) $this->user->data['user_id'],
|
||||
'user_id' => ($user_id <= 0) ? (int) $this->user->data['user_id'] : (int) $user_id,
|
||||
);
|
||||
$sql = 'SELECT oauth_provider_id, provider FROM ' . $this->auth_provider_oauth_token_account_assoc . '
|
||||
WHERE ' . $this->db->sql_build_array('SELECT', $data);
|
||||
|
|
|
@ -166,6 +166,10 @@ interface provider_interface
|
|||
/**
|
||||
* Returns an array of data necessary to build the ucp_auth_link page
|
||||
*
|
||||
* @param int $user_id User ID for whom the data should be retrieved.
|
||||
* defaults to 0, which is not a valid ID. The method
|
||||
* should fall back to the current user's ID in this
|
||||
* case.
|
||||
* @return array|null If this function is not implemented on an auth
|
||||
* provider then it returns null. If it is implemented
|
||||
* it will return an array of up to four elements of
|
||||
|
@ -181,7 +185,7 @@ interface provider_interface
|
|||
* 'VARS' => array(...),
|
||||
* )
|
||||
*/
|
||||
public function get_auth_link_data();
|
||||
public function get_auth_link_data($user_id = 0);
|
||||
|
||||
/**
|
||||
* Unlinks an external account from a phpBB account.
|
||||
|
|
Loading…
Add table
Reference in a new issue