]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Don't depend on ModLog
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 13 Feb 2016 00:10:01 +0000 (01:10 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 13 Feb 2016 00:10:01 +0000 (01:10 +0100)
plugins/RegisterThrottle/RegisterThrottlePlugin.php
plugins/RegisterThrottle/actions/ipregistrations.php

index 1150cd01127674220cec48ba23fae75aed85ff5a..88f2a9677139447017ff49a1255eb0f2ce55fb0d 100644 (file)
@@ -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;
         }
 
index 31217483b5790cd4c36a1c11531dc9162e6afc31..a748a9d0b2e05468bf5eb10328f5186f10932023 100644 (file)
@@ -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');