c2corg / v6_ui

UI for c2c.org v6
GNU Affero General Public License v3.0
7 stars 12 forks source link

Moderator tools: merge account #1542

Closed desnoes closed 6 years ago

desnoes commented 7 years ago

It should be possible to merge 2 users accounts. At least an user with 'compte fermé'. The identifiers (topo and forum) of a merged account shall not be visible in any document and in the forum. All documents that have been created or modified shall be updated. All the messages of the forum shall be updated.

asaunier commented 7 years ago

Note: should rather be an API issue because most of the tasks are performed on the API side.

@desnoes Should this tool be available form the UI (website)? If yes, who should be able to merge accounts? Moderators? Or should we keep the v5-approach (a script to run by hand in the server command line)?

Note: source of v5 command line tool https://github.com/c2corg/camptocamp.org/blob/master/batch/mergeUsers.php

Some tasks from the document merging or deleting tools could perhaps be reused:

Tasks performed when merging accounts

Discourse tasks:

Guidebook tasks:

If command line interface:

If web interface is needed (is it??): TBD

arnaud-morvan commented 7 years ago

I trust you on the topoguide side, there is a bunch of relationships with users, but this sounds reasonably feasible, as we have direct access to ORM, so this can be done in one request / transaction.

I've already done that sort of stuff in discourse, because some users have changed their email during forum migration, see : https://github.com/c2corg/v6_forum/issues/90.

So I've searched for user's posts and manually changed owner one by one on each post through discourse UI (passing through ORM). As far as I know, there is no discourse tool to do this as batch (and I've searched for). This may be possible through Discourse API, but it should result in a lot of requests, not included in a transaction, and we may encounter an error in the middle of process.

Concerning private messages, I've done it directly in SQL, but this is not the recommended way of changing data in discourse. No idea if this is possible through API. Note that Topoguide API process do not have direct access to discourse database.

There should be other thing related to users in discourse, but this not really relevant I suppose. After changing posts owner, I was able to delete the user.

desnoes commented 7 years ago

@desnoes Should this tool be available form the UI (website)? If yes, who should be able to merge accounts? Moderators? Or should we keep the v5-approach (a script to run by hand in the server command line)?

I have no experience in merging account. Was it frequent in V5 ? If not and running a script by hand is not too cumbersome, let's go for it.

fbunoz commented 7 years ago

I have no experience in merging account. Was it frequent in V5 ? If not and running a script by hand is not too cumbersome, let's go for it.

Merging an account is also used to delete an account, as all spamer accounts. With spamers ang regular users, we need merge about 100 to 200 account per year.

asaunier commented 7 years ago

I have no experience in merging account. Was it frequent in V5 ?

Use cases are:

For the spammers, in v5 those accounts were either deleted or merged with the "compte fermé", especially when all there messages had not been deleted yet. There were 2 scripts, 1 for deleting and 1 for merging. In v6 is it complicated to remove spam messages? Anyway the accounts have to be removed, so perhaps it is better to stick to the merging procedure instead of developing a special "deleting" tool for those accounts.

Using a web interface

2 tools could be created:

Pros:

Cons:

Using a script

Pros:

Cons:

asaunier commented 6 years ago

The API PR https://github.com/c2corg/v6_api/pull/660 has finally been merged. Please note it has no impact on the Discourse side.

stef74 commented 6 years ago

@desnoes @asaunier it is in prod ?

asaunier commented 6 years ago

Yes but never tested

desnoes commented 6 years ago

I have created and modified some documents in order to have some test cases for testing the merge of accounts.

Compte à fusionner avec 'compte fermé':

loicperrin commented 6 years ago

@desnoes dans tes tests, il faudrait ajouter l'ajout de photos.

asaunier commented 6 years ago

@desnoes Could you remind me the id of "compte fermé" ?

cbeauchesne commented 6 years ago

https://www.camptocamp.org/profiles/811780/fr

asaunier commented 6 years ago

@desnoes Merge done on the demo.

desnoes commented 6 years ago

@asaunier: Many thanks. All the tests are ok. We can put this PR in prod.

asaunier commented 6 years ago

@desnoes Actually the PR has been merged weeks or months ago and is already in prod :P