X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FModHelper%2FModHelperPlugin.php;h=45b8bf27d10947b7307a325e9793bb2d084aa475;hb=10f17efc4f5a4eb9af09aef8397726dab0d164db;hp=bed0d8d49e3d8160e98535d3e2e5cf347aecb663;hpb=04ad0838bee46ad9b2cd8520d13d8287e86aec93;p=quix0rs-gnu-social.git diff --git a/plugins/ModHelper/ModHelperPlugin.php b/plugins/ModHelper/ModHelperPlugin.php index bed0d8d49e..45b8bf27d1 100644 --- a/plugins/ModHelper/ModHelperPlugin.php +++ b/plugins/ModHelper/ModHelperPlugin.php @@ -17,9 +17,7 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET')) { - exit(1); -} +if (!defined('GNUSOCIAL')) { exit(1); } /** * @package ModHelperPlugin @@ -29,12 +27,12 @@ class ModHelperPlugin extends Plugin { static $rights = array(Right::SILENCEUSER, Right::TRAINSPAM, Right::REVIEWSPAM); - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { $versions[] = array('name' => 'ModHelper', - 'version' => STATUSNET_VERSION, + 'version' => GNUSOCIAL_VERSION, 'author' => 'Brion Vibber', - 'homepage' => 'http://status.net/wiki/Plugin:ModHelper', + 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ModHelper', 'rawdescription' => // TRANS: Plugin description. _m('Lets users who have been manually marked as "modhelper"s silence accounts.')); @@ -45,7 +43,9 @@ class ModHelperPlugin extends Plugin function onUserRightsCheck($profile, $right, &$result) { if (in_array($right, self::$rights)) { - // Hrm.... really we should confirm that the *other* user isn't privleged. :) + // To silence a profile without accidentally silencing other + // privileged users, always call Profile->silenceAs($actor) + // since it checks target's privileges too. if ($profile->hasRole('modhelper')) { $result = true; return false;