[ticket/15716] Remove OAuth data upon user deletion

PHPBB3-15716
This commit is contained in:
Jakub Senko 2018-09-06 14:31:57 +02:00
parent bd90a53589
commit 0f10c6ff6f
No known key found for this signature in database
GPG key ID: 6A7C328CD66EC21E
4 changed files with 11 additions and 1 deletions

View file

@ -664,7 +664,7 @@ function user_delete($mode, $user_ids, $retain_username = true)
delete_posts('poster_id', $user_ids);
}
$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE);
$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE, $phpbb_container->getParameter('tables.auth_provider_oauth_token_storage'), $phpbb_container->getParameter('tables.auth_provider_oauth_states'), $phpbb_container->getParameter('tables.auth_provider_oauth_account_assoc'));
// Delete the miscellaneous (non-post) data for the user
foreach ($table_ary as $table)

View file

@ -94,6 +94,9 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case
'auth.provider_collection',
$provider_collection
);
$phpbb_container->setParameter('tables.auth_provider_oauth_token_storage', 'phpbb_oauth_tokens');
$phpbb_container->setParameter('tables.auth_provider_oauth_states', 'phpbb_oauth_states');
$phpbb_container->setParameter('tables.auth_provider_oauth_account_assoc', 'phpbb_oauth_accounts');
parent::setUp();
}

View file

@ -82,6 +82,10 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case
$phpbb_container->set('auth.provider.oauth.service.google', $oauth_provider_google);
$phpbb_container->set('auth.provider_collection', $provider_collection);
$phpbb_container->set('notification_manager', $notification_manager);
$phpbb_container->setParameter('tables.auth_provider_oauth_token_storage', 'phpbb_oauth_tokens');
$phpbb_container->setParameter('tables.auth_provider_oauth_states', 'phpbb_oauth_states');
$phpbb_container->setParameter('tables.auth_provider_oauth_account_assoc', 'phpbb_oauth_accounts');
}
public function test_user_delete()

View file

@ -46,6 +46,9 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
'auth.provider_collection',
$provider_collection
);
$phpbb_container->setParameter('tables.auth_provider_oauth_token_storage', 'phpbb_oauth_tokens');
$phpbb_container->setParameter('tables.auth_provider_oauth_states', 'phpbb_oauth_states');
$phpbb_container->setParameter('tables.auth_provider_oauth_account_assoc', 'phpbb_oauth_accounts');
}
public function first_last_post_data()