X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FAutopromote.php;h=21567878868a0033194a713d604ec42f10df900e;hb=924aec77e561b679eaba2231475eeee64af09766;hp=a4130371b8469f608b4a19ffc956f4d59ecea5e4;hpb=20e65a191541681c05d289efaf4edb20429da73d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Autopromote.php b/includes/Autopromote.php index a4130371b8..2156787886 100644 --- a/includes/Autopromote.php +++ b/includes/Autopromote.php @@ -21,6 +21,8 @@ * @file */ +use MediaWiki\MediaWikiServices; + /** * This class checks if user can get extra rights * because of conditions specified in $wgAutopromote @@ -198,10 +200,11 @@ class Autopromote { case APCOND_IPINRANGE: return IP::isInRange( $user->getRequest()->getIP(), $cond[1] ); case APCOND_BLOCKED: - // @TODO Should partial blocks prevent auto promote? - return (bool)$user->getBlock(); + return $user->getBlock() && $user->getBlock()->isSitewide(); case APCOND_ISBOT: - return in_array( 'bot', User::getGroupPermissions( $user->getGroups() ) ); + return in_array( 'bot', MediaWikiServices::getInstance() + ->getPermissionManager() + ->getGroupPermissions( $user->getGroups() ) ); default: $result = null; Hooks::run( 'AutopromoteCondition', [ $cond[0],