• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

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

ManagerJosh

Well-known member
#1
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
#2
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
#3
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
 

ManagerJosh

Well-known member
#5
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
#7
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
#8
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
#9
I can't reproduce that, though I'm testing with the tweaked code.

Here's the unified diff for library/Model/SpamPrevention.php:
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
#10
I can't reproduce that, though I'm testing with the tweaked code.

Here's the unified diff for library/Model/SpamPrevention.php:
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?