mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: don't limit registration from an IP address if a staff member has that IP address
This commit is contained in:
@ -9,6 +9,13 @@ class SpamHandler
|
||||
|
||||
return false if tl2_plus_accounts_with_same_ip > 0
|
||||
|
||||
staff_user_ids = Group[:staff].user_ids - [-1]
|
||||
staff_members_with_same_ip = User.where(id: staff_user_ids)
|
||||
.where("ip_address = ?", ip_address.to_s)
|
||||
.count
|
||||
|
||||
return false if staff_members_with_same_ip > 0
|
||||
|
||||
tl0_accounts_with_same_ip = User.unscoped
|
||||
.where(trust_level: TrustLevel[0])
|
||||
.where("ip_address = ?", ip_address.to_s)
|
||||
|
Reference in New Issue
Block a user