Deleting user accounts

General discussion of Mantis.

Moderators: Developer, Contributor

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

Deleting user accounts

Post by ajtruckle » Nov 03, 2018 2:35 am

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: 7677
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Deleting user accounts

Post by atrol » Nov 04, 2018 4:38 am

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: Oct 16, 2011 2:21 am

Re: Deleting user accounts

Post by ajtruckle » Nov 04, 2018 4:43 am

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: Oct 30, 2018 4:15 am

Re: Deleting user accounts

Post by DorseyLey » Nov 06, 2018 8:48 am

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?

atrol
Site Admin
Posts: 7677
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Deleting user accounts

Post by atrol » Nov 06, 2018 9:41 am

DorseyLey wrote:
Nov 06, 2018 8:48 am
can 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: Feb 06, 2019 3:19 am

Re: Deleting user accounts

Post by Raindrop » Feb 13, 2019 2:31 am

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: 58
Joined: Jun 04, 2019 7:17 pm

Re: Deleting user accounts

Post by amphetamine » Oct 08, 2019 7:24 pm

atrol wrote:
Nov 04, 2018 4:38 am
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: 668
Joined: Mar 11, 2006 11:08 am
Contact:

Re: Deleting user accounts

Post by cas » Oct 10, 2019 6:18 am

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

Post Reply