Deleting user accounts

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
ajtruckle
Posts: 69
Joined: 16 Oct 2011, 07:21

Deleting user accounts

Post by ajtruckle »

There are accounts on my system that were created in 2011 and last used in 2011. How can I delete all accounts that were last used before 1 January 2016?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Deleting user accounts

Post by atrol »

As an example, check manage_user_prune.php to see how to delete users who have never logged in and are older than 1 week.

Keep in mind that
- there is no other undo after deleting users, than to restore a database backup
- wherever the deleted user is referenced (e.g. issues he created, notes he added), you will see the user name as a striked through User<ID>

So maybe you better just deactivate users instead of deleting them.
Please use Search before posting and read the Manual
ajtruckle
Posts: 69
Joined: 16 Oct 2011, 07:21

Re: Deleting user accounts

Post by ajtruckle »

Thanks. I don't see the point of having users in my database who have not used the resource in years.

But i don't want to fiddle with writing any PHP script or using phpadmin.

I would be much more comfortable with a user interface approach.
DorseyLey
Posts: 1
Joined: 30 Oct 2018, 09:15

Re: Deleting user accounts

Post by DorseyLey »

Hi Atrol, I was thinking along the same lines as the OP. But now that you mentioned deactivating users, I was wondering can you reactivate a deactivated user again?
Here are some of the best crossbows money can buy.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Deleting user accounts

Post by atrol »

DorseyLey wrote: 06 Nov 2018, 13:48can you reactivate a deactivated user again?
You can. Use Manage > Manage Users page for it. Enable check box "Show Disabled", click "Apply Filter" and order by column "Enabled"
Please use Search before posting and read the Manual
Raindrop
Posts: 1
Joined: 06 Feb 2019, 08:19

Re: Deleting user accounts

Post by Raindrop »

I don't think deleting them would be the best idea. Maybe putting them in a dormant mode would be the best option because you can reactivate whenever you want.
amphetamine
Posts: 113
Joined: 05 Jun 2019, 00:17

Re: Deleting user accounts

Post by amphetamine »

atrol wrote: 04 Nov 2018, 09:38 As an example, check manage_user_prune.php to see how to delete users who have never logged in and are older than 1 week.

Keep in mind that
- there is no other undo after deleting users, than to restore a database backup
- wherever the deleted user is referenced (e.g. issues he created, notes he added), you will see the user name as a striked through User<ID>

So maybe you better just deactivate users instead of deleting them.
the mistake I was made by accident :x
Is possible to re-add the deleted user through phpmyadmin? (same id, user name, email, etc.,)
I've tried, but get the #1062 error and don't know how to fixed it.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Deleting user accounts

Post by cas »

error 1062 stands for duplicate row (dupilicate primary key) , seems you try to add a user which is already there :mrgreen:
Post Reply