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?
 
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.
 
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.webp
 
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
 
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.
 
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?
 
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.)
 
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?
 
Top Bottom