mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-05 23:25:30 +02:00
Merge branch '3.3.x'
This commit is contained in:
commit
0bf84e5803
@ -91,6 +91,7 @@ $lang = array_merge($lang, array(
|
|||||||
'ATTACHED_IMAGE_NOT_IMAGE' => 'The image file you tried to attach is invalid.',
|
'ATTACHED_IMAGE_NOT_IMAGE' => 'The image file you tried to attach is invalid.',
|
||||||
'AUTHOR' => 'Author',
|
'AUTHOR' => 'Author',
|
||||||
'AUTH_NO_PROFILE_CREATED' => 'The creation of a user profile was unsuccessful.',
|
'AUTH_NO_PROFILE_CREATED' => 'The creation of a user profile was unsuccessful.',
|
||||||
|
'AUTH_PROVIDER_OAUTH_ERROR_ALREADY_LINKED' => 'The account is already linked with other user.',
|
||||||
'AUTH_PROVIDER_OAUTH_ERROR_INVALID_ENTRY' => 'Invalid database entry.',
|
'AUTH_PROVIDER_OAUTH_ERROR_INVALID_ENTRY' => 'Invalid database entry.',
|
||||||
'AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE' => 'Invalid service type provided to OAuth service handler.',
|
'AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE' => 'Invalid service type provided to OAuth service handler.',
|
||||||
'AUTH_PROVIDER_OAUTH_ERROR_SERVICE_NOT_CREATED' => 'OAuth service not created',
|
'AUTH_PROVIDER_OAUTH_ERROR_SERVICE_NOT_CREATED' => 'OAuth service not created',
|
||||||
|
@ -634,6 +634,21 @@ class oauth extends \phpbb\auth\provider\base
|
|||||||
*/
|
*/
|
||||||
protected function link_account_perform_link(array $data)
|
protected function link_account_perform_link(array $data)
|
||||||
{
|
{
|
||||||
|
// Check if the external account is already associated with other user
|
||||||
|
$sql = 'SELECT user_id
|
||||||
|
FROM ' . $this->auth_provider_oauth_token_account_assoc . "
|
||||||
|
WHERE provider = '" . $this->db->sql_escape($data['provider']) . "'
|
||||||
|
AND oauth_provider_id = '" . $this->db->sql_escape($data['oauth_provider_id']) . "'";
|
||||||
|
$result = $this->db->sql_query($sql);
|
||||||
|
$row = $this->db->sql_fetchrow($result);
|
||||||
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
|
if ($row)
|
||||||
|
{
|
||||||
|
trigger_error('AUTH_PROVIDER_OAUTH_ERROR_ALREADY_LINKED');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Link account
|
||||||
$sql = 'INSERT INTO ' . $this->auth_provider_oauth_token_account_assoc . '
|
$sql = 'INSERT INTO ' . $this->auth_provider_oauth_token_account_assoc . '
|
||||||
' . $this->db->sql_build_array('INSERT', $data);
|
' . $this->db->sql_build_array('INSERT', $data);
|
||||||
$this->db->sql_query($sql);
|
$this->db->sql_query($sql);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user