X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=blobdiff_plain;f=includes%2Fuser%2FPasswordReset.php;h=fd8eb3fac1677b6eeb3794dce65de67d95eb2542;hb=1dcf5b66d33ebade1c5cc8d3b2803aa70c8bb958;hp=ef104cce5c1e7120e50de4787359c4670956c86d;hpb=747bdd543d301e0816aa811806c6cc6b17ec1038;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/user/PasswordReset.php b/includes/user/PasswordReset.php index ef104cce5c..fd8eb3fac1 100644 --- a/includes/user/PasswordReset.php +++ b/includes/user/PasswordReset.php @@ -70,8 +70,6 @@ class PasswordReset implements LoggerAwareInterface { /** * Check if a given user has permission to use this functionality. * @param User $user - * @param bool $displayPassword If set, also check whether the user is allowed to reset the - * password of another user and see the temporary password. * @since 1.29 Second argument for displayPassword removed. * @return StatusValue */ @@ -81,9 +79,7 @@ class PasswordReset implements LoggerAwareInterface { $resetRoutes = $this->config->get( 'PasswordResetRoutes' ); $status = StatusValue::newGood(); - if ( !is_array( $resetRoutes ) || - !in_array( true, array_values( $resetRoutes ), true ) - ) { + if ( !is_array( $resetRoutes ) || !in_array( true, $resetRoutes, true ) ) { // Maybe password resets are disabled, or there are no allowable routes $status = StatusValue::newFatal( 'passwordreset-disabled' ); } elseif ( @@ -265,23 +261,7 @@ class PasswordReset implements LoggerAwareInterface { if ( !$block ) { return false; } - $type = $block->getSystemBlockType(); - if ( in_array( $type, [ null, 'global-block' ], true ) ) { - // Normal block. Maybe it was meant for someone else and the user just needs to log in; - // or maybe it was issued specifically to prevent some IP from messing with password - // reset? Go out on a limb and use the registration allowed flag to decide. - return $block->isCreateAccountBlocked(); - } elseif ( $type === 'proxy' ) { - // we disallow actions through proxy even if the user is logged in - // so it makes sense to disallow password resets as well - return true; - } elseif ( in_array( $type, [ 'dnsbl', 'wgSoftBlockRanges' ], true ) ) { - // these are just meant to force login so let's not prevent that - return false; - } else { - // some extension - we'll have to guess - return true; - } + return $block->appliesToPasswordReset(); } /**