Forum OpenACS Q&A: Combining user accounts

Collapse
Posted by Richard Hamilton on
I have searched for a posting about this but cannot find one so thought I would ask....

I have been testing the user registration features and checking/ changing the default emails in an openacs-4-6 installation. This has meant that I needed to keep registering valid emails that route back to me - I only have two. The acs has a perfect memory and if you login with an email that it knows (even if deleted) it will offer to re-activate the user account. This was no good for me so I have had to edit the users email address as admin so that I could register the email afresh. OK, so now what I want to do is eliminate completely the spurious records. I notice that one of the email messages to users says something like "If you want to combine two accounts email the admin" - but in this case the admin can't work out how to do it!!

So in essence then - can anyone tell me how to actually truly delete a user record or alternatively combine two or more into one?


Many Thanks
Richard
Collapse
Posted by Don Baccus on
Ouch, we should probably change that message for the time being unless someone wants to tackle merging accounts.

Some history ...

The old ACS 3.x system did include the (very useful) ability to merge accounts.  When ACS 4 was developed, that and several other useful user management tools did not get re-implemented in the new framework.

Then Ars Digita embarked on their ACS Java rewrite, and work stopped on ACS 4.

That's when our project, originally meant to simply provide PostgreSQL support for Ars Digita's Oracle-based ACS toolkits, took over the entire Tcl-based ACS realm.

We're now just getting to the point where we're starting to pay attention to some of the serious shortcomings in the administration tools for users, groups, subsites etc.  There's going to be substantial work done for OpenACS 4.7.

So ... I'd appreciate your filing a bug report describing this problem.  Can't promise it will get addressed by 4.7.  Of course ... if you want to dig in and try to figure out how to implement the feature we can certainly give you lots of advice and help!

Collapse
Posted by Richard Hamilton on

Thanks for the reply Don.

I think I might have a go at tackling the delete user completely bit first!. Maybe if I study the data model around users and find all tables where user_id appears I might be able to safely remove them

Once I have done that maybe it will be possible to simply allocate one user_id as the desired master user_id and re-write references to the other ids on all other tables

Any pointers much appreciated


Regards
Richard
Collapse
Posted by Jeff Davis on
I have something that pulls out all the foreign key references (without indexes, but just change the code to get them all) for postgresql at http://xarg.net/download/fk.tcl.txt and there is corresponding query for oracle at
http://osi.oracle.com/~tkyte/unindex/index.html
that will do it for oracle.  It would be great if we
could get some of this stuff cleaned up.
Collapse
Posted by Tom Jackson on

For another purpose, I just finished a very simple dm browser, at least enough to identify what references users, or any other table. Should I tar it up and email it? Sorry only postgres at this point.

Collapse
Posted by Richard Hamilton on
That would be great - yes please.
Richard
Collapse
Posted by Tom Jackson on

I decided to place the files on my website.

Note that there is also a patch. Apparently db_multirow does have the ability to extend the number of vars per row, however there was a bug in the source so that if you tried to use it, it would barf. I'm not sure how anyone ever tested their code with this bug in place. I'll also submit the bug report.

Collapse
Posted by Don Baccus on
That code's been used so if it's been broken it's recent ...
Collapse
Posted by Richard Hamilton on
Don,
I'll file the bug report - just wanted to make sure that Simon's testing server is the correct place to do it or is there somewhere in the cvs system that I need to learn about?
Regards
Richard
Collapse
Posted by Richard Hamilton on
Tom,
Thanks very much for posting the files - I am just about to play with them! Did you intend to post the patched version of ns_sendmail.tcl or was there another patch that you had in mind?

On the subject of ns_sendmail I have patched mine to allow me to send out simple Mime emails. The extra \n renders them unreadable in MS Outlook. I posted the patch :
https://openacs.org/forums/message-view?message_id=51834

Regards
Richard
Collapse
Posted by Richard Hamilton on
OK, here we go - first sweep through on a basic install with just the photo album, ecommerce module and payment gateways installed.

I am assuming that the key values user_id, person_id, object_id and party_id are the same numeric key and therefore relatable between tables.

I created a user whose user_id was 4740, then deleted him as a member of the acs then after deleting him I searched for all references to this key in the acs. Results as follows :

Appears as party_id in:

  • parties
  • party_approved_member_map
  • party_element_map
  • party_member_map
  • party_names

Appears as person_id in:
  • persons

Appears as user_id in:
  • users
  • user_portraits
  • user_preferences
  • cc_users

Appears as object_id in:
  • acs_objects
  • acs_object_context
  • acs_object_context_index
  • acs_object_grantee_priv_map
  • acs_object_party_privilege_map
  • acs_object_paths
  • acs_permissions
  • acs_permissions_all
  • acs_rels
  • all_object_party_privilege_map

I think that this list takes care of most of it except where an object (user) is the parent of content in the content repository. I think that someone really familiar with the content repository data model would be needed to create the required queries to remove content. Presumably requires a self join to work down the hierarchy. Maybe each package owner could create a query to drop all content by object_id which someone else could then collate into a global drop script.
Richard