Users mass actions

Started by emanuele, August 17, 2011, 04:49:32 PM

Previous topic - Next topic

emanuele

Link to Mod

Gives admins the possibility to execute several actions on multiple users at a time through the Manage Members interface (Admin > Members > View All Members or Search For Members).

The actions available are:

  • Delete
  • Change (or remove) primary member group
  • Change (or remove) additional member groups
  • Ban
    • by usernames
    • by email addresses
    • by usernames an email addresses
    • by IPs
The name of the ban list where the new ban are added can be configured in Admin > Configuration > Modification Settings.


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.

IanF2

I have installed, and nothing is showing up. Unclear if I need to do any of the manual changes or does it totally installed automatically with the Package Manager ? SMF 2.0

I am definitely looking for some more power in Banning and monitoring members.

Any help appreciated.

emanuele

Didn't you get the changes in the admin member list like shown in the picture?

If you installed it through the package manager and you didn't get any error then the edits should be in place...
In case you don't see anything in Admin > Members > View All Members then attach your ManageMembers.php so that I can have a look and see if the edits are there.


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.

IanF2

Here is the attached file, as requested.

emanuele

The edits are done properly.
You should see the options where they should be, I can't see any reason why the drop down box shouldn't be there...

It should not be relevant, but are you using the default theme?
Do you have any error in the log that could be somehow related to this?


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.

IanF2

Apologies. I was looking in the wrong place, inside the general Member list and Search area, rather than inside the Admin menu.

Should have looked inside: Administration Center » Members » View All Members

Thanks for the mod. great start for the control I need over Spammers etc.  :-[

IanF2

Just a warning with this mod...

When using the search for members filters and then actioning members on the page... the next page that shows members no longer respects the original search filters. The danger is obvious, if you continue to select members thinking you are looking at the original selection you will then processing the wrong members.

Hope this is easy to fix?

emanuele

I doubt it's a problem of the mod, it simply adds few html tags...

I've never been able to keep the search parameters "stable" between different pages of the search members page in the admin area searching for example by dates: when I switch to the second page the filter is always ignored.

And I just tested this behaviour with SMF 2.0 without this mod...I think it's a bug.


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.

blink2010


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.

babyxdeja

I'm getting this error:

Installations actions for "Users mass actions" The package you are trying to download or install is either corrupt or not compatible with this version of SMF.


I got this for some Karma Mod too and I changed one of the files to "Install for 2.0 RC5" and it worked.. this is a tar.gz file tho, and I can't get into it to see the code... Any suggestions?

emanuele

Please use the emulate version feature (or better upgrade to SMF 2.0 final! ;)).


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.

babyxdeja

SMF 2.0 is the newest version? Where do I upgrade my forum at?

babyxdeja

ok I figured it out.. thanks

Sheda

Hey, i had to do one step manually, because of the Stop Spammer Mod.
Guess i'd write it here, in case others encounter this.

That's what it looks like, now (hope it's correct).
I think the only problem is that the code "Users mass actions" replaces isn't right behind the 'additional_rows'-thing, but it has been pushed down by the other mod.

'additional_rows' => array(
!$modSettings['stopspammer_enable'] ? '' :
array(
'position' => 'below_table_data',
'value' => '
<div style="text-align: center">' . $modSettings['stopspammer_count'] . ' ' . $txt['stopspammer_count'] . '</div>',
'class' => 'titlebg',
),
!$modSettings['stopspammer_enable'] ? '' :
array(
'position' => 'below_table_data',
'value' => '
<div style="margin: auto" class="leyend_stopspammer">
<img src="' . $GLOBALS['settings']['default_images_url'] . '/icons/moreinfo.gif" alt="Icon MoreInfo" style="vertical-align: middle" /> ' . $txt['stopspammer_leyd01'] . '<br />
<img src="' . $GLOBALS['settings']['default_images_url'] . '/icons/suspect.gif" alt="Icon Suspect" style="vertical-align: middle" /> ' . $txt['stopspammer_leyd02'] . '<br />
<img src="' . $GLOBALS['settings']['default_images_url'] . '/icons/spammer.gif" alt="Icon Spammer" style="vertical-align: middle" /> ' . $txt['stopspammer_leyd03'] . '<br />
</div>',
'class' => 'titlebg',
),
!$modSettings['stopspammer_enable'] ? '' :
array(
'position' => 'below_table_data',
'value' => '
<label>' . $txt['in_stop_forum_spam'] . '</label>
<input type="submit" name="spammers_checks" value="' . $txt['spammers_checks'] . '" onclick="return confirm(\'' . $txt['confirm_spammers_checks'] . '\');" />
<input type="submit" name="spammers_report" value="' . $txt['spammers_report'] . '" onclick="return confirm(\'' . $txt['confirm_spammers_report'] . '\');" />',
'class' => 'titlebg','titlebg',
'style' => 'text-align: right;',
),
array(
'position' => 'below_table_data',
'value' => '
<select name="maction" onchange="this.form.new_membergroup.disabled = (this.options[this.selectedIndex].value != \'pgroup\' && this.options[this.selectedIndex].value != \'agroup\');">
<option value="">--------</option>
<option value="delete">' . $txt['admin_delete_members'] . '</option>
<option value="pgroup">' . $txt['admin_change_primary_membergroup'] . '</option>
<option value="agroup">' . $txt['admin_change_secondary_membergroup'] . '</option>
<option value="ban_names">' . $txt['admin_ban_usernames'] . '</option>
<option value="ban_mails">' . $txt['admin_ban_useremails'] . '</option>
<option value="ban_names_mails">' . $txt['admin_ban_usernames_and_emails'] . '</option>
<option value="ban_ips">' . $txt['admin_ban_userips'] . '</option>
</select>
<select onchange="if(this.value==-1){if(!confirm(\'' . $txt['confirm_remove_membergroup'] . '\')){this.value=0;}}" name="new_membergroup" id="new_membergroup" disabled="disabled">' .
createGroupsList() . '</select>
<input type="submit" name="maction_on_members" value="' . $txt['quick_mod_go'] . '" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" class="button_submit" />',
'style' => 'text-align: right;',
),
),

Kaitlyn

Server error - It may be down for maintenance or configured incorrectly, when I tried the code you posted for Users mass actions & stop spammer wondering does anyone know the code for both mods to work together

Kaitlyn

does anybody know the code that works for both mods installed Users mass actions & Stop spammer

emanuele

Exatly which one of the two edits in this mod doesn't work with stop spammer? (also please when you ask for help on a mod, would be very nice if you put the link to the mod, so that people helping don't have to go and search for something that you need ;))


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.

Kaitlyn

Quote from: Sheda on October 15, 2011, 03:05:52 PM
Hey, i had to do one step manually, because of the Stop Spammer Mod.
Guess i'd write it here, in case others encounter this.

That's what it looks like, now (hope it's correct).
I think the only problem is that the code "Users mass actions" replaces isn't right behind the 'additional_rows'-thing, but it has been pushed down by the other mod.

'additional_rows' => array(
!$modSettings['stopspammer_enable'] ? '' :
array(
'position' => 'below_table_data',
'value' => '
<div style="text-align: center">' . $modSettings['stopspammer_count'] . ' ' . $txt['stopspammer_count'] . '</div>',
'class' => 'titlebg',
),
!$modSettings['stopspammer_enable'] ? '' :
array(
'position' => 'below_table_data',
'value' => '
<div style="margin: auto" class="leyend_stopspammer">
<img src="' . $GLOBALS['settings']['default_images_url'] . '/icons/moreinfo.gif" alt="Icon MoreInfo" style="vertical-align: middle" /> ' . $txt['stopspammer_leyd01'] . '<br />
<img src="' . $GLOBALS['settings']['default_images_url'] . '/icons/suspect.gif" alt="Icon Suspect" style="vertical-align: middle" /> ' . $txt['stopspammer_leyd02'] . '<br />
<img src="' . $GLOBALS['settings']['default_images_url'] . '/icons/spammer.gif" alt="Icon Spammer" style="vertical-align: middle" /> ' . $txt['stopspammer_leyd03'] . '<br />
</div>',
'class' => 'titlebg',
),
!$modSettings['stopspammer_enable'] ? '' :
array(
'position' => 'below_table_data',
'value' => '
<label>' . $txt['in_stop_forum_spam'] . '</label>
<input type="submit" name="spammers_checks" value="' . $txt['spammers_checks'] . '" onclick="return confirm(\'' . $txt['confirm_spammers_checks'] . '\');" />
<input type="submit" name="spammers_report" value="' . $txt['spammers_report'] . '" onclick="return confirm(\'' . $txt['confirm_spammers_report'] . '\');" />',
'class' => 'titlebg','titlebg',
'style' => 'text-align: right;',
),
array(
'position' => 'below_table_data',
'value' => '
<select name="maction" onchange="this.form.new_membergroup.disabled = (this.options[this.selectedIndex].value != \'pgroup\' && this.options[this.selectedIndex].value != \'agroup\');">
<option value="">--------</option>
<option value="delete">' . $txt['admin_delete_members'] . '</option>
<option value="pgroup">' . $txt['admin_change_primary_membergroup'] . '</option>
<option value="agroup">' . $txt['admin_change_secondary_membergroup'] . '</option>
<option value="ban_names">' . $txt['admin_ban_usernames'] . '</option>
<option value="ban_mails">' . $txt['admin_ban_useremails'] . '</option>
<option value="ban_names_mails">' . $txt['admin_ban_usernames_and_emails'] . '</option>
<option value="ban_ips">' . $txt['admin_ban_userips'] . '</option>
</select>
<select onchange="if(this.value==-1){if(!confirm(\'' . $txt['confirm_remove_membergroup'] . '\')){this.value=0;}}" name="new_membergroup" id="new_membergroup" disabled="disabled">' .
createGroupsList() . '</select>
<input type="submit" name="maction_on_members" value="' . $txt['quick_mod_go'] . '" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" class="button_submit" />',
'style' => 'text-align: right;',
),
),


Sheda had posted right before my post the code for using usermass & stop spammer I used this code so I could use both mods on my forum but it doesn't work correctly

emanuele

What are you doing when you get the server error?


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.

Kaitlyn

when I click members where stop spammers & users mass mods are placed the page is configured incorrectly can't view that page

walker

Any chance future releases of this mod will include Ban by post count?

chr05210084

#22
Hi, this the mod that I need to ban multiple human spammers at once. I installed this mod along with stop forum spam, I encountered one error during installation but I managed to fix it by editing the "/Sources/ManageMembers.php" file. The problem now is whenever I ban a user/users using this mod, they are not listed on the ban list. I also tried creating a ban list called "Mass bans" but its still not working. Any help would be greatly appreciated.

Can you also add mass ban and delete features. Integrating this mod also in "Awaiting Approval" page would be a great help to ban the spammers that blocked by the Stop Forum Spam module without scrolling to a mix list of legitimate users and spammers in the "View All Members" page.

Thanks.

chr05210084

I found the problem, the below codes was not inserted during the installation process to I manually added it to the "Source/ManageMembers.php" file.

// Are we performing a mass action?
if (isset($_POST['maction_on_members']) && isset($_POST['maction']) && !empty($_POST['delete']))
{
checkSession();

// Clean the input.
foreach ($_POST['delete'] as $key => $value)
{
$_POST['delete'][$key] = (int) $value;
// Don't delete yourself, idiot.
if ($value == $user_info['id'])
unset($_POST['delete'][$key]);
}
// Are we performing a delete?
if ($_POST['maction'] == 'delete' && allowedTo('profile_remove_any'))
{
if (!empty($_POST['delete']))
{
// Delete all the selected members.
require_once($sourcedir . '/Subs-Members.php');
deleteMembers($_POST['delete'], true);
}
}
// Are we changing groups?
if (($_POST['maction'] == 'pgroup' || $_POST['maction'] == 'agroup') && allowedTo('manage_membergroups'))
{
$groups = array('p', 'a');
foreach($groups as $group){
if ($_POST['maction'] == $group . 'group' && !empty($_POST['new_membergroup']))
{
if($group=='p')
$type = 'force_primary';
else
$type = 'only_additional';

if (!empty($_POST['delete']))
{
// Change all the selected members' group.
require_once($sourcedir . '/Subs-Membergroups.php');
if($_POST['new_membergroup'] != -1)
addMembersToGroup($_POST['delete'], $_POST['new_membergroup'], $type, true);
else
removeMembersFromGroups($_POST['delete'],null,true);
}
}
}
}
// Are we banning?
if(($_POST['maction'] == 'ban_names' || $_POST['maction'] == 'ban_mails' || $_POST['maction'] == 'ban_ips' || $_POST['maction'] == 'ban_names_mails') && allowedTo('manage_bans'))
{
require_once($sourcedir . '/ManageBans.php');

$id_ban = $smcFunc['db_query']('', '
SELECT id_ban_group
FROM {db_prefix}ban_groups
WHERE name = \'' . $modSettings['users_mass_action_ban_name'] . '\'
LIMIT 1',
array()
);
if($smcFunc['db_num_rows']($id_ban)!=0)
list($ban_group_id) = $smcFunc['db_fetch_row']($id_ban);
else
$ban_group_id = null;

$smcFunc['db_free_result']($id_ban);

$members = array();
$_REQUEST['bg'] = $ban_group_id;

// Set up an array of bans
foreach ($_POST['delete'] as $key => $value)
if ($value != $user_info['id'])
// Don't ban yourself, idiot.
$members[] = (int) $value;

$mactions = $_POST['maction'] == 'ban_names_mails' ? array('ban_names', 'ban_mails') : array($_POST['maction']);

foreach ($mactions as $maction) {
$checkIPs = false;
switch ($maction) {
case 'ban_names':
$what = 'member_name';
$post_ban = 'user';
$_POST['ban_suggestion'][] = 'user';
$_POST['bantype'] = 'user_ban';
break;
case 'ban_mails':
$what = 'email_address';
$post_ban = 'email';
$_POST['ban_suggestion'][] = 'email';
$_POST['bantype'] = 'email_ban';
break;
case 'ban_ips':
$checkIPs = true;
$what = 'member_ip';
$post_ban = !empty($ban_group_id) ? 'ip' : 'main_ip';
$_POST['ban_suggestion'][] = 'main_ip';
$_POST['bantype'] = 'ip_ban';
break;
default:
return false;
}
$request = $smcFunc['db_query']('', '
SELECT id_member, member_name, ' . $what . '
FROM {db_prefix}members
WHERE id_member IN ({array_int:id_members})',
array(
'id_members' => $members,
));

$_POST['expiration'] = 'never';
$_POST['full_ban'] = 1;
$_POST['reason'] = !empty($modSettings['users_mass_action_ban_name']) ? $modSettings['users_mass_action_ban_name'] : 'Mass ban';
$_POST['ban_name'] = !empty($modSettings['users_mass_action_ban_name']) ? $modSettings['users_mass_action_ban_name'] : 'Mass ban';
$_POST['notes'] = '';

while ($row = $smcFunc['db_fetch_assoc']($request))
{
if ($checkIPs) {
$ip_parts = ip2range($row[$what]);
if (users_mass_action_checkExistingTriggerIP($ip_parts, $row[$what]))
continue;

$_POST['ip'] = $row[$what];
}
$_POST['add_new_trigger'] = !empty($ban_group_id) ? 1 : null;
$_POST['add_ban'] = empty($ban_group_id) ? 1 : null;
$_POST[$post_ban] = $row[$what];
$_REQUEST['u'] = $row['id_member'];

BanEdit();
if(empty($ban_group_id)){
$id_ban = $smcFunc['db_query']('', '
SELECT id_ban_group
FROM {db_prefix}ban_groups
WHERE name = \'Mass bans\'
LIMIT 1',
array()
);
if($smcFunc['db_num_rows']($id_ban)!=0)
list($ban_group_id) = $smcFunc['db_fetch_row']($id_ban);
else
$ban_group_id = null;
$smcFunc['db_free_result']($id_ban);
}
}
$smcFunc['db_free_result']($request);
}
}
}

kirkvan

This mod looks great, but I'm receiving the following upon trying to install:

   1.   Execute Modification   ./Sources/ManageMembers.php   Test failed
   1.   Replace   ./Sources/ManageMembers.php   Test successful
   2.   Replace   ./Sources/ManageMembers.php   Test failed

Screen capture attachment included. Please advise.

emanuele

Do you have other mods installed?
It is most likely some other mod that changed something in the same place.


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.

vbgamer45

Great mod for antispam! Should be in main SMF.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Arantor

I prefer not to let members register in the first place, rather than optimising clean-up afterwards ;)

LoupVert

Hello community,

I've just installed my first SMF forum, updated it to 2.04, installed some nice package and then installed a new theme.

Could have been all fine but there are some lines are sticking out like a sore thumb‎ above my header.

It looks like it come from this package so I uninstalled and deleted it but the the text was still there, so I uninstalled all other package I had but it's still a no-go.



Could you please help me to get my header nice and clean?

Arantor

Let me guess, you installed the Are You Human mod at some point?

LoupVert

Quote from: Arantor on April 17, 2013, 07:04:27 AM
Let me guess, you installed the Are You Human mod at some point?

Sounds like I should have avoided to.  :-\

Is there a cure?

Arantor

Yup. Find your Themes/default/languages/Modifications.english.php (no you cannot edit it from the admin panel), and look for the ?> symbol.

There should only be one, at the very end of the file, but Are You Human is buggy and puts one where it should not. Delete the extra ?> and you should be good to go.

LoupVert

Thanks a lot Arantor and, emanuele, sorry for having spoiled your thread with offtopics things.

Arantor

I don't think it's really that off-topic, seeing how it could easily look like a bug with this mod.

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.

T3CHN0

Thankyou so much for this MOD
I had to make some edits to the ManageMembers php file
but other then that the install was sweet and saved me a bunch of time
editing each member.

How do I send you $5 to have a drink on me :)



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.

MoreBloodWine

I assum the "username and email" option is meant as triggers so there's just one ban and not a ban on username and trigger making two bans per user right ?

Anyway, if that's the case, would you please considder adding a Username, email & IP option ?

Ty.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


emanuele

If I remember correctly, I didn't add the option because of the way SMF handles IP bans (i.e. it checks the IP are not already banned and it throws a fatal error if so), that would require some more rewrite then I wanted to do for this mod.


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.

MoreBloodWine

Even while IP's can change, a bot can continually come back on the same IP meaning more bans on a lo of usernames and emails.

I'm open to thoughts, but I would like to see the before mentioned option.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


emanuele

The point is/was not if it is better to ban IPs or names (and if you ask around you'll get different opinions on that, but that's life ;)), but that I (personally) didn't want to bother to rewrite the function/s (don't remember exactly the details) dealing with bans just for that (incidentally I did rewrite quite a good amount of the manage bans code in 2.1 to be able to expand this mod... O:-) ...and not because I was a team member, but just because I felt so).


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.

Prids

Hi,

I only discovered this excellent Mod fairly recently, and appreciate that support for it may have ended.  It works fine on my SMF Forum 2.0.12

My questions are:
1.  Can I have this automated in any way so as by click of a button or even auto on my log-in, the script will run and I can auto-ban members who have not logged in for, say, 370 days, and present them with the 'nag' screen when/if  they try to come back?
2.  Can these 'banned' people be highlighted in some way on the Admin > Members screen (only).

I don't want them deleted from the memberlist, or highlighted in any way to members, which is already currently the case using the Mod to, to my satisfaction and I send thanks for it.

I'm just looking to simplify the Admin tasks over a rather large list of members.

Awesome Regards,

Paul

Advertisement: