• Welcome to Simple Machines Community Forum. Please login or sign up.
December 06, 2021, 12:40:14 PM

News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord


[4716] Remove Inactive Members bug.

Started by ethankcvds, December 06, 2010, 11:36:37 PM

Previous topic - Next topic

ethankcvds

December 06, 2010, 11:36:37 PM Last Edit: May 11, 2011, 08:42:41 PM by Illori
I've noticed over the past couple of days on my install of SMF 2.0 RC4 that Remove Inactive Members is removing people from the list that it should not be removing. For example some one registered today and I ran the the Remove Inactive Members with the activated their account after 30 days options it removes the act that just registered today from the list of members and those waiting for them to activate their account.

Similar to: http://www.simplemachines.org/community/index.php?topic=239823.msg1546396#msg1546396
No Pm's for support please!

michau

I might have experienced similar problem, trying to reproduce it now - will post details as soon as I'm able to provide repetitive scenario.

In addition to that, I also run into out of memory problem when trying to run the clean up on around 14k members, where at least half should have been cleaned up. Cranking memory to 384MB directly in Subs-Members.php help for that.

Thx,
michau

emanuele

May 06, 2011, 09:07:29 AM #2 Last Edit: May 08, 2011, 11:46:28 AM by emanuele
If it helps, this can be solved by changing in ManageMaintenance.php
Code (search) Select
$where_vars = array(
'last_login' => $time_limit,
);
$where = 'mem.last_login < {int:last_login}';
if ($_POST['del_type'] == 'activated')
{
$where .= ' AND mem.is_activated = {int:is_activated}';
$where_vars['is_activated'] = 0;
}


Code (replace with) Select
$where_vars = array(
'last_login' => $time_limit,
'date_registered' => $time_limit,
);
if ($_POST['del_type'] == 'activated')
{
$where = 'mem.date_registered < {int:date_registered} AND mem.is_activated = {int:is_activated}';
$where_vars['is_activated'] = 0;
} else {
$where = 'mem.last_login < {int:last_login}';
}


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

ethankcvds

Quote from: emanuele on May 06, 2011, 09:07:29 AM
If it helps, this can be solved by changing in ManageMembers.php
Code (search) Select
$where_vars = array(
'last_login' => $time_limit,
);
$where = 'mem.last_login < {int:last_login}';
if ($_POST['del_type'] == 'activated')
{
$where .= ' AND mem.is_activated = {int:is_activated}';
$where_vars['is_activated'] = 0;
}


Code (replace with) Select
$where_vars = array(
'last_login' => $time_limit,
'date_registered' => $time_limit,
);
if ($_POST['del_type'] == 'activated')
{
$where = 'mem.date_registered < {int:date_registered} AND mem.is_activated = {int:is_activated}';
$where_vars['is_activated'] = 0;
} else {
$where = 'mem.last_login < {int:last_login}';
}


Fix's this issue. Also do note that the code you need to replace is in ManageMaintenance.php not ManageMembers.php

ethankcvds
No Pm's for support please!

emanuele

Quote from: ethankcvds on May 08, 2011, 08:56:21 AM
Also do note that the code you need to replace is in ManageMaintenance.php not ManageMembers.php
Right. :-[
I should stop doing two things at the same time, especially when the two files are named more or less the same... :P


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

ethankcvds

An other thing is this fixed in the latest SVN version or is it still there? If not is it going to be tracked in the bug tracker and fixed for 2.0 final?
No Pm's for support please!

Illori

this does not seem to be fixed in smf, i am not sure a bug report was created, and if it has been it should be added to the title of this thread.

ethankcvds

Quote from: Illori on May 11, 2011, 05:27:51 PM
this does not seem to be fixed in smf, i am not sure a bug report was created, and if it has been it should be added to the title of this thread.

Just found it on the bug tracker http://dev.simplemachines.org/mantis/view.php?id=4716.
No Pm's for support please!

live627

This needs moved. The associated issue in Mantis is resolved.

minky

I am running smf 2.0.2 when using 'Remove Inactive members' it also removes members who have a last_login = '0', this includes newish members who have not yet logged in.

It would be preferable if the option:

(1) did not delete accounts not yet activated (as there are options to deal with these elsewhere), or recently activated.

(2) Deleted those who had not logged in for > than the entered time span, those who with last_login == 0 && date_registered > time span

or perhaps

Activation results in a last_login of the date of activation.

Be very gratefull of a solution  :)




emanuele

Yes, that's something that I find annoying (though I don't use pruning, so I forget rather quickly of it... :P).
In ManageMaintenance.php:

Code (find) Select
$where = 'mem.last_login < {int:time_limit}';

Code (replace with) Select
$where = 'mem.last_login < {int:time_limit} AND (mem.last_login != 0 OR mem.date_registered < {int:time_limit})';

That way it should not delete the member that didn't do their first login in the last xx (30) days.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

minky

Thank you emanuele, exactly what I needed, much appreciated.  8)

Advertisement: