[ABD] Delete Inactive Users

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
User avatar
mr.ruf
Registered User
Posts: 136
Joined: Thu Apr 04, 2013 11:12 pm
Location: PuErTo RiCo
Name: Harold

Re: [DEV] Delete Inactive Users

Post by mr.ruf »

oh oh oh..... ok , is another extension thanks i try now :lol:
User avatar
John P
Registered User
Posts: 1237
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John

Re: [DEV] Delete Inactive Users

Post by John P »

Unpack the zip and copy all files and folders where you find composer.json to the destination folder on your webserver.
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign
User avatar
Raul [ThE KuKa]
Style Customisations
Style Customisations
Posts: 11137
Joined: Mon Dec 08, 2003 9:24 pm
Location: Spain
Name: Raul Arroyo

Re: [DEV] Delete Inactive Users

Post by Raul [ThE KuKa] »

"PR" translation spanish ready. ;)
Last edited by Raul [ThE KuKa] on Tue Nov 04, 2014 10:34 pm, edited 1 time in total.
All unsolicited PMs will be ignored.
:warning: Knowledge Base | Documentation | Board rules | phpBB Styles Rules & Policies | Styles Queue Stats :warning:


If you like my styles, translations, etc. and want to show some appreciation, then feel free to Donate.
:flag_es: phpBB Spain - Online Since 2003 :heart:


User avatar
John P
Registered User
Posts: 1237
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John

Re: [DEV] Delete Inactive Users

Post by John P »

Thanks raul
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign
User avatar
mr.ruf
Registered User
Posts: 136
Joined: Thu Apr 04, 2013 11:12 pm
Location: PuErTo RiCo
Name: Harold

Re: [DEV] Delete Inactive Users

Post by mr.ruf »

another question how i install "extension upload" ? no find any instruction to this
User avatar
John P
Registered User
Posts: 1237
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John

Re: [DEV] Delete Inactive Users

Post by John P »

Did you read readme.md?

1.Download the extension. You can do it directly by downloading the latest ZIP-archive of master branch of its GitHub repository.
2.Check out the existing of the folder /ext/boardtools/upload/ in the root of your board folder. Create folders if necessary.
3.Copy the contents of the downloaded upload-master folder to /ext/boardtools/upload/ .
4.Navigate in the ACP to Customise -> Extension Management -> Manage extensions -> Upload Extensions .
5.Click Enable .
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign
leschek
Registered User
Posts: 856
Joined: Tue Jul 18, 2006 12:49 pm

Re: [DEV] Delete Inactive Users

Post by leschek »

Is this start working when I enable the extension in customise tab, or after I click "Submit" button in "Board features" settings?
User avatar
mr.ruf
Registered User
Posts: 136
Joined: Thu Apr 04, 2013 11:12 pm
Location: PuErTo RiCo
Name: Harold

Re: [DEV] Delete Inactive Users

Post by mr.ruf »

thank you very much, I followed all the instructions and install the extension using "extension upload", it was very easy :D
User avatar
mr.ruf
Registered User
Posts: 136
Joined: Thu Apr 04, 2013 11:12 pm
Location: PuErTo RiCo
Name: Harold

Re: [DEV] Delete Inactive Users

Post by mr.ruf »

I have other questions to clear my doubts and benefit others I'm sure have the same doubts.

1. will be deleted users to register and (using an example) in 30 days at no time have connected?

but ...

2. will be deleted users who are inactive for 30 days even though they were once connected?

(I mean were reported entered and commented on the topics of the forum and then remained inactive for 30 days) they are removed too?

Thanks for being patient with me and help me in this matter
Holger
Registered User
Posts: 1886
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Re: [DEV] Delete Inactive Users

Post by Holger »

Swedish translation

BTW, you have a typo in the English lang-file
User avatar
Walther
Registered User
Posts: 301
Joined: Fri Jul 09, 2004 5:21 pm
Location: The Netherlands

Re: [DEV] Delete Inactive Users

Post by Walther »

Walther wrote:So, only those who are member of the "newly registered users group", not members de-activated by the admin with 0 postings due to *whatever reason* the admin had to de-activate them.
WHAAA!!!
All users who where made inactive for good reasons, but we did not want to delete them, DELETED!!!!
Crap, not going to use this extension any more, now finding out how to restore backup, as that does not seem to work from the ACP :evil:

-------------------------------------------

EDIT: It's 5 hour's later, had the database restored, but forgot that in the database backup the extension was still enabled.
So when i went to the ACP, all the users are AGAIN deleted, whether they where in the newly registered group or not, being de-activated was enough.

So now, waiting for mysqldump to finish the restore of over 5 million records, i dived into the code.
Think there is a 'error', or at least, vague part in the code.

Code: Select all

$sql = 'SELECT user_id, username, user_regdate FROM ' . USERS_TABLE . ' WHERE user_type = ' . USER_INACTIVE . ' AND user_new = 1 AND user_regdate < ' . $expire_date; 
Concerning the AND user_new = 1 part, Should dat not be better "1" or still beter (but don't know for the moment if it is boolean) just TRUE or FALSE ?
On our mySQL server, users who had serveral postings but where placed inactive by the admin where simply deleted, so the user_new was not checked properly.
User avatar
mr.ruf
Registered User
Posts: 136
Joined: Thu Apr 04, 2013 11:12 pm
Location: PuErTo RiCo
Name: Harold

Re: [DEV] Delete Inactive Users

Post by mr.ruf »

well I think this extension desactivare for now, until we get a new update, but I'm still very interested :D
User avatar
John P
Registered User
Posts: 1237
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John

Re: [DEV] Delete Inactive Users

Post by John P »

user_new is a integer so that's ok.
user_new is set to 0 if the user is removed from the NRG so it won't delete inactive users who once where active.
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign
User avatar
Walther
Registered User
Posts: 301
Joined: Fri Jul 09, 2004 5:21 pm
Location: The Netherlands

Re: [DEV] Delete Inactive Users

Post by Walther »

John P wrote:... it won't delete inactive users who once where active
ALL users who where not active or de-activated, with or without postings, pm's and so on, got deleted :idea:
I'm not kidding!

I adapted the query to be able to run it straight in phpMyAdmin, the user_type of inactive users = 1 on our board, don't know if that differs from board to board.

When I run the following (adapted: variables are hard coded) query in phpMyAdmin, all users who are inactive get selected:
SELECT user_id, username, user_regdate FROM phpbb3_users WHERE user_type = 1 AND user_new = 1;

Even those users who are *NOT* in the "Newly registered users" group, the value of them is 1 in the field user_new

HOWEVER:
When I run the test query with one extra variable, it works: user_inactive_reason
SELECT user_id, username, user_regdate FROM phpbb3_users WHERE user_type = 1 AND user_new = 1 AND user_inactive_reason = 1;

The following list seems to apply for user_inactive_reason:
  • 0 = nothing, user is not inactive
    1 = Newly registered account
    2 = Profile details changed
    3 = Account deactivated by administrator
    4 = Forced user account reactivation
So, be on the safe site, or make it even more configurable, but my suggestion is to change the query:
$sql = 'SELECT user_id, username, user_regdate FROM ' . USERS_TABLE . ' WHERE user_type = ' . USER_INACTIVE . ' AND user_new = 1 AND user_regdate < ' . $expire_date;
into:
$sql = 'SELECT user_id, username, user_regdate FROM ' . USERS_TABLE . ' WHERE user_type = ' . USER_INACTIVE . ' AND user_new = 1 AND user_inactive_reason = 1 AND user_regdate < ' . $expire_date;

Maybe skip the whole user_new part, because sometimes even when the users have the required number of postings, they are still listed in the newly registered group, until their postings is required+1.

edit: found reason #4 for user_inactive_reason
And a shorter SQL doing the exact same could be:
$sql = 'SELECT user_id, username, user_regdate FROM ' . USERS_TABLE . ' WHERE user_inactive_reason = 1 AND user_regdate < ' . $expire_date;
leschek
Registered User
Posts: 856
Joined: Tue Jul 18, 2006 12:49 pm

Re: [DEV] Delete Inactive Users

Post by leschek »

Walther wrote:ALL users who where not active or de-activated, with or without postings, pm's and so on, got deleted :idea:
Unfortunately it's true. I just tested it on testing board converted from phpBB 3.0.x. I deactivated user who was member since 2006 and have 1 post. Next day he was deleted. It even didn't wait for 30 days I set in "Delete inactive users:" option.

Return to “Abandoned Extensions”