Advertisement:

Author Topic: [4716] Remove Inactive Members bug.  (Read 9898 times)

Offline ethankcvds

  • Jr. Member
  • **
  • Posts: 310
  • Gender: Male
[4716] Remove Inactive Members bug.
« on: December 06, 2010, 11:36:37 PM »
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
« Last Edit: May 11, 2011, 08:42:41 PM by Illori »
No Pm's for support please!

Offline michau

  • Newbie
  • *
  • Posts: 1
Re: Remove Inactive Members bug.
« Reply #1 on: January 04, 2011, 11:46:02 AM »
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

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: Remove Inactive Members bug.
« Reply #2 on: May 06, 2011, 09:07:29 AM »
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}';
}
« Last Edit: May 08, 2011, 11:46:28 AM by emanuele »


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.

Offline ethankcvds

  • Jr. Member
  • **
  • Posts: 310
  • Gender: Male
Re: Remove Inactive Members bug.
« Reply #3 on: May 08, 2011, 08:56:21 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!

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: Remove Inactive Members bug.
« Reply #4 on: May 08, 2011, 11:50:04 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.

Offline ethankcvds

  • Jr. Member
  • **
  • Posts: 310
  • Gender: Male
Re: Remove Inactive Members bug.
« Reply #5 on: May 11, 2011, 05:24:38 PM »
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!

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 48,081
Re: Remove Inactive Members bug.
« Reply #6 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.

Offline ethankcvds

  • Jr. Member
  • **
  • Posts: 310
  • Gender: Male
Re: Remove Inactive Members bug.
« Reply #7 on: May 11, 2011, 08:40:16 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!

Offline live627

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,265
  • Gender: Male
  • Cat: Destroy!
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: [4716] Remove Inactive Members bug.
« Reply #8 on: May 28, 2011, 07:52:53 PM »
This needs moved. The associated issue in Mantis is resolved.
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline minky

  • Newbie
  • *
  • Posts: 3
Re: [4716] Remove Inactive Members bug.
« Reply #9 on: July 26, 2012, 11:40:58 AM »
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  :)




Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: [4716] Remove Inactive Members bug.
« Reply #10 on: July 26, 2012, 12:12:27 PM »
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.

Offline minky

  • Newbie
  • *
  • Posts: 3
Re: [4716] Remove Inactive Members bug.
« Reply #11 on: July 27, 2012, 06:34:27 AM »
Thank you emanuele, exactly what I needed, much appreciated.  8)