Fixed I must "Moderate registrations when this many warning flags are detected"

ManagerJosh

Well-known member
I'm noticing that if I unclick "Moderate registrations when this many warning flags are detected" under spam management, XenForo refuses to reject registrations.

Bug?
 

Jeremy

Well-known member
There should be a setting about rejecting accounts.

However, if you don't want to moderate or reject, you should turn off the spam features completely.
 

ManagerJosh

Well-known member
This is the behavior I want to see:

If one more flags are detected, users are to be rejected. They are not to be sent into moderation. I can't use the setting below because it creates a logic error. I can't uncheck "moderate registrations" because then reject registrations are not being observed.

Capture - XF.JPG
 

Jeremy

Well-known member
If you untick the "Moderate Registrations" it should reject after one flag is found.
 

ManagerJosh

Well-known member
If you untick the "Moderate Registrations" it should reject after one flag is found.
For some strange reason on our XF install, it's not. It's approving them. We can tell because when we do a verification manually via SFS, we see at least one flag on the system, but it didn't stop the registration
 

Mike

XenForo developer
Staff member
Yeah, looks like the code here is bugged. However, it does look like if you set them both to the same level, the deny should take over.
 

ManagerJosh

Well-known member
Yeah, looks like the code here is bugged. However, it does look like if you set them both to the same level, the deny should take over.
Mike, even with two flags, it's not rejecting at the moment.

The latest example would be the following flags we see queued up:

email: weatheg5700@gmail.com
IP: 5.135.160.149


BTW, should I flag a report into the bug tracking area?
 

Mike

XenForo developer
Staff member
I can't reproduce that, though I'm testing with the tweaked code.

Here's the unified diff for library/Model/SpamPrevention.php:
Rich (BB code):
@@ -127,21 +127,14 @@
            {
                $flagCount = $this->_getSfsSpamFlagCount($apiResponse);
                if ($sfsOptions['moderateThreshold'] && $flagCount >= (int)$sfsOptions['moderateThreshold'])
                {
-                    if ($sfsOptions['denyThreshold'] && $flagCount >= (int)$sfsOptions['denyThreshold'])
-                    {
-                        $decision = self::RESULT_DENIED;
-                    }
-                    else
-                    {
-                        $decision = self::RESULT_MODERATED;
-                    }
-
-                    /*if ($sfsOptions['submitRejections'])
-                    {
-                        $this->submitSpamUserData($user);
-                    }*/
+                    $decision = self::RESULT_MODERATED;
+                }
+
+                if ($sfsOptions['denyThreshold'] && $flagCount >= (int)$sfsOptions['denyThreshold'])
+                {
+                    $decision = self::RESULT_DENIED;
                }

                if (!$fromCache)
                {
You can add the lines in green and remove the lines in red. (Don't include the leading - or + on those lines.)
 

dieg0

Active member
I can't reproduce that, though I'm testing with the tweaked code.

Here's the unified diff for library/Model/SpamPrevention.php:
Rich (BB code):
@@ -127,21 +127,14 @@
            {
                $flagCount = $this->_getSfsSpamFlagCount($apiResponse);
                if ($sfsOptions['moderateThreshold'] && $flagCount >= (int)$sfsOptions['moderateThreshold'])
                {
-                    if ($sfsOptions['denyThreshold'] && $flagCount >= (int)$sfsOptions['denyThreshold'])
-                    {
-                        $decision = self::RESULT_DENIED;
-                    }
-                    else
-                    {
-                        $decision = self::RESULT_MODERATED;
-                    }
-
-                    /*if ($sfsOptions['submitRejections'])
-                    {
-                        $this->submitSpamUserData($user);
-                    }*/
+                    $decision = self::RESULT_MODERATED;
+                }
+
+                if ($sfsOptions['denyThreshold'] && $flagCount >= (int)$sfsOptions['denyThreshold'])
+                {
+                    $decision = self::RESULT_DENIED;
                }

                if (!$fromCache)
                {
You can add the lines in green and remove the lines in red. (Don't include the leading - or + on those lines.)
Do we need to set them both to the same level after implementing this change in order to get the deny behaviour?
 

MikeMpls

Well-known member
Thanks, that explains what I've been seeing since I upgraded one of my busier (and more targeted by spammers) sites to 1.2.1.
 
Top