Users mass actions

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

Previous topic - Next topic

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


Advertisement: