Problems with updating mod for 2.1

Started by Matthias, March 23, 2022, 11:46:44 AM

Previous topic - Next topic

Matthias

Actually I'm updating the Mod "Stop Spammer" for 2.1

Unfortunately, I have some problems with it.
In Admin Center>Members you can check or report multiple selected users at once (see screenshot).


Unfortunately this does not work. The search parameters for username, email adress and IP are not passed. I have no idea why...
If you mark users and click "Check selected member" or "Report selected members" is the following error message in the log:

hxxps://domain.tld/test02-smf2-1-1/index.php?action=admin;area=viewmembers
/var/www/vhosts/domain.tld/httpdocs/test02-smf2-1-1/Sources/ManageMembers.php (Line 291)
Type of error: Undefined
Error message
2: Undefined array key "types"

Line 291 in ManageMembers.php:     
$search_params['types'] = $_POST['types'];
In the ManageMembers.php is the following change for this:
            'user_name' => array(
                'header' => array(
                    'value' => $txt['username'],
                ),
                $modSettings['stopspammer_enable'] ? '' :
                'data' => array(
                    'sprintf' => array(
                        'format' => '<a href="' . strtr($scripturl, array('%' => '%%')) . '?action=profile;u=%1$d">%2$s</a>',
                        'params' => array(
                            'id_member' => false,
                            'member_name' => false,
                        ),
                    ),
                ),
                !$modSettings['stopspammer_enable'] ? '' :
                'data' => array(
                    'function' => function($rowData) {
                        global $scripturl;
                        $url = strtr($scripturl, array('%' => '%%')) . '?action=profile;u=' . $rowData['id_member'];
                        return sprintfspamer_21($rowData, $url, 'member_name', 2);
                    },
                ),
                'sort' => array(
                    'default' => 'member_name',
                    'reverse' => 'member_name DESC',
                ),
            ),


I suspect this has to do with the link.
The function in StopSpammer.php for this is the following:
function sprintfspamer_21(&$value, $url, $index, $type)
{
    global $txt, $settings, $modSettings;

    $is_spamer = (!$modSettings['stopspammer_enable'] || 3 != $value['is_activated']) ? 0 : $value['is_spammer'];

    $format1 = $modSettings['stopspammer_enable'] && $type && (($bol_1 = $is_spamer >> ($type - 1) & 1) || ($bol_2 = 8 == $is_spamer) || $modSettings['stopspammer_show01'])
        ? '<a href="http://www.stopforumspam.com/search?q=' . urlencode($value[$index]) . '" target="_blank"><img src="' . $settings['default_images_url'] . '/icons/' . ($bol_1 ? 'spammer21' : ($bol_2 ? 'suspect21' : 'moreinfo21')) . '.png" alt="[' . $txt['search'] . ']" title="' . $txt['stopspammer_title'] . '" style="vertical-align: middle" /></a>' : '';

    $format2 = $is_spamer % 8 ? array('<span class="error">', '</span>') : array('', '');

    return $format1 . '<a href="'. $url . '">' . implode($value[$index], $format2) . '</a>';
}

I have attached the following files:
StopSpammer.php
Modified Register.php
Modified ManageMember.php
The whole mod as it is at the moment

I would be very grateful if someone could help me who has more idea than me.
Quality first

Arantor

Just in case you didn't know there is a SFS package for 2.1 that might do everything you need without trying to update this mod?

https://custom.simplemachines.org/index.php?mod=4311
Holder of controversial views, all of which my own.


Shades.

Quote from: Matthias on March 23, 2022, 11:46:44 AMActually I'm updating the Mod "Stop Spammer" for 2.1

Unfortunately, I have some problems with it.
In Admin Center>Members you can check or report multiple selected users at once (see screenshot).


Unfortunately this does not work. The search parameters for username, email adress and IP are not passed. I have no idea why...
If you mark users and click "Check selected member" or "Report selected members" is the following error message in the log:

Quote from: Arantor on March 23, 2022, 12:44:20 PMJust in case you didn't know there is a SFS package for 2.1 that might do everything you need without trying to update this mod?

https://custom.simplemachines.org/index.php?mod=4311
Just an FYI the function/option the OP is talking about in this mod isn't available in the 2.1 version. ;)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Arantor

Honestly, since I don't use SFS - never have, and never had a spam problem in any case - I don't actually know what the relative feature sets are. I just didn't know if it was well known that a 2.1 mod does exist for SFS something.
Holder of controversial views, all of which my own.


Matthias

I did not know the mod yet.
Now I'm pretty annoyed because I spent hours trying to get it to work for 2.1.
I haven't looked lately because there was this discussion: https://www.simplemachines.org/community/index.php?msg=4114597
I'll try the mod from SleePy.

For me it definitely doesn't work without spam protection, despite constantly changing questions, recaptcha, etc.

@Arantor
What sign up settings are you using? Because you say you have no problem with spam.
Quality first

Arantor

I've been using anti spam Q&A for years, decent sized pool of good questions, rotation regularly. I also added the additional layers of hardening that are in 2.1.(The reason SMF 2.1 has the timegate on registration, the improved Q&A, some other tricks that aren't so well known, that's me.)

I also never had Tapatalk enabled which may have helped.

I'm at the stage where in the forum I had running until end of last year, I had *guest posting* running without significant drama.
Holder of controversial views, all of which my own.


Matthias

I agree that I use a large pool questions that constantly rotates.

However, in my largest forum, this does not really help. There are still between 5 and 10 spam registrations per day.
The questions must not be too hard either in my opinion, otherwise people will just click that away again....

Nowadays it's not that easy to run a forum that's been around for almost 20 years.
Quality first

landyvlad

Matthias maybe your question/answer structure isn't ideal?

It's not actually the pool of questions that matters - technically - it's the pool of answers.
So having 20 true or false questions is a very bad idea, as opposed to
Type the capital letters in this phrase "D%agBT*Y"
to which the answer would be DBTY. Not a word so not as easy to crack.

Make sure the answers to your questions are different and change periodically.

Hope that makes sense.
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Matthias

Exactly as you describe it are my questions.
Example:
Enter only the upper case letters: dwFHdwEFki
Just enter the numbers: sk43gfj945vj

This is changed every few months. With questions like these, it's very simple to change.
Unfortunately, this does not help. There are still some spam registrations every day.
Quality first

Kindred

Do you have tapatalk?


Because, seriously, with 20 questions, asking 2 and changing once a year, NONE of my sites have has a spam bot in years and only a very few live-human spammers.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Matthias

I have never used tapatalk. A couple of years ago, I saw that tapatalk isn't a good idea because of security holes.

Today I have changed the questions, hopefully it will be better since the last change. At the last change, there was no spam registration for a few days, maybe less than weeks. But step by step it has grown up from time to time, little more, little more... and so on.
Fortunately, the mod stop spammer has filtered out the registrations.

The server also runs many things that have nothing to do with SMF. There are no abnormalities in the server's logs.



Quality first

landyvlad

Do you have guest posting allowed?  I'd kill that if so.
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Matthias

I have changed the questions again. Since then, fortunately, there are no more spam registrations.
Let's see how long...
Quality first

MadMick

Quote from: landyvlad on March 31, 2022, 02:22:07 AMDo you have guest posting allowed?  I'd kill that if so.

Ahh yip, I have never allowed guest posting and only allow guests to view our Welcome topic. Must be time to change my questions as I have noticed one or two suss accounts this year :). I only have 7 questions set now and use five of them, last time they changed was Sept or Oct last year. All our questions are firearms based but the answers are like one of the above posts, list capital letters, numbers etc, this system works the best out of all I have tried in the last 20 odd years.

Cheers and thanks to whoever the genius was that came up with it  :)
Regards,

Mick.

AHN Moderators - Can explain it to you, but they can't understand it for you"

Kindred

That's  bad ratio that is going to get cataloged fast.

Add 30 questions,  ask 2.

The random selection will keep your questions from being cataloged for a while.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Matthias

At the end of March I changed the questions according to the following scheme

Enter only the upper case letters: dwFHdwEFki
Just enter the numbers: sk43gfj945vj

20 questions, 2 must be answered.
Since then I have not had any spam registrations.
Quality first

Matthias

What's important:
The answers to the questions must not be in a dictionary, no matter what the languages are.
Quality first

Advertisement: