From 799c2e47fe208f6fe111e035cf7824447d790b0b Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth <mmn@hethane.se>
Date: Sat, 13 Feb 2016 01:10:01 +0100
Subject: [PATCH] Don't depend on ModLog

---
 plugins/RegisterThrottle/RegisterThrottlePlugin.php  | 4 ++--
 plugins/RegisterThrottle/actions/ipregistrations.php | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/RegisterThrottle/RegisterThrottlePlugin.php b/plugins/RegisterThrottle/RegisterThrottlePlugin.php
index 1150cd0112..88f2a96771 100644
--- a/plugins/RegisterThrottle/RegisterThrottlePlugin.php
+++ b/plugins/RegisterThrottle/RegisterThrottlePlugin.php
@@ -155,8 +155,8 @@ class RegisterThrottlePlugin extends Plugin
         }
 
         $scoped = $action->getScoped();
-        if (!$scoped instanceof Profile || !$scoped->hasRight(self::VIEWMODLOG)) {
-            // only continue if we are allowed to VIEWMODLOG
+        if (!$scoped->hasRight(Right::SILENCEUSER)) {
+            // only show registration IP if we have the right to silence users
             return true;
         }
 
diff --git a/plugins/RegisterThrottle/actions/ipregistrations.php b/plugins/RegisterThrottle/actions/ipregistrations.php
index 31217483b5..a748a9d0b2 100644
--- a/plugins/RegisterThrottle/actions/ipregistrations.php
+++ b/plugins/RegisterThrottle/actions/ipregistrations.php
@@ -15,8 +15,8 @@ class IpregistrationsAction extends ManagedAction
 
     protected function doPreparation()
     {
-        if (!$scoped->hasRight(self::VIEWMODLOG) && !$scoped->hasRole(Profile_role::ADMINISTRATOR)) {
-            throw new AuthorizationException(_('You do not have privileges to see this page'));
+        if (!$scoped->hasRight(Right::SILENCEUSER) && !$scoped->hasRole(Profile_role::ADMINISTRATOR)) {
+            throw new AuthorizationException(_('You are not authorized to view this page.'));
         }
 
         $this->ipaddress    = $this->trimmed('ipaddress');
-- 
2.39.5