Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Delete Users but not their Links

Quote Reply
Delete Users but not their Links
Hello ...

The default is that when a user gets deleted, all the user's links go too. This might not suit all LSQL administrators. Some might consider it potentially disastrous.

Can anyone think of an easy workaround?
For example:
* On deleting a user, admin becomes the owner of all the user's links
or
* While deleting a user, select a new owner from a dropdown list -- with a blank alternative option for no new owner (thus deletion of the links).
Quote Reply
Re: [YoYoYoYo] Delete Users but not their Links In reply to
The *easy* way may be to null out the fk lines in Links.def and/or Users.def

As for updating the user to Admin, you'd need to do that manually, from the SQL Monitor.

Not sure the effect of this action :)

The *BEST* way would be to go to the SQL Monitor, and

UPDATE prefix_Links Set LinkOwner = 'Admin' where LinkOwner = "BadUser"

Then delete the user. By changing the LinkOwner, the "BadUser" no longer has any ties to the Links table.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [YoYoYoYo] Delete Users but not their Links In reply to
Just delete from Users.def

Before:

'fk_tables' => [
'Links',
'Changes',
'Sessions',
'Editors',
],

After:

'fk_tables' => [
'Changes',
'Sessions',
'Editors',
],

And from Links.def

Before:

'fk' => {
'Users' => {
'LinkOwner' => 'Username',

},

After:

'fk' => {
},
Quote Reply
Re: [Troja] Delete Users but not their Links In reply to
Uhhh, I wouldn't do that. These foreign key relations are used to join tables, so you might get unexpected results. The system depends on these relations, they are not there to be deleted!

But anyway, when deleting a user, there should be an option to transfer their links to somebody else (e.g. admin). A plugin could do that easily.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Delete Users but not their Links In reply to
Hopefully, GT staff will read this and recognize that there is a genuine issue here -- but one they could fix very easily.

Should be a Setup option.

Right now, I'm using the raw MySQL option. It's easy for me, but I can't hand over admin responsibilities to anyone else until everything can be done via the Admin interface.