dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Parser: Use 'Special:Badtitle/Parser' instead of 'NO TITLE'"
[lhc/web/wiklou.git]
/
includes
/
user
/
PasswordReset.php
diff --git
a/includes/user/PasswordReset.php
b/includes/user/PasswordReset.php
index
aada319
..
38707de
100644
(file)
--- a/
includes/user/PasswordReset.php
+++ b/
includes/user/PasswordReset.php
@@
-22,6
+22,7
@@
use MediaWiki\Auth\AuthManager;
use MediaWiki\Auth\TemporaryPasswordAuthenticationRequest;
use MediaWiki\Auth\AuthManager;
use MediaWiki\Auth\TemporaryPasswordAuthenticationRequest;
+use MediaWiki\Permissions\PermissionManager;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use MediaWiki\Logger\LoggerFactory;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use MediaWiki\Logger\LoggerFactory;
@@
-40,6
+41,9
@@
class PasswordReset implements LoggerAwareInterface {
/** @var AuthManager */
protected $authManager;
/** @var AuthManager */
protected $authManager;
+ /** @var PermissionManager */
+ private $permissionManager;
+
/** @var LoggerInterface */
protected $logger;
/** @var LoggerInterface */
protected $logger;
@@
-50,9
+54,14
@@
class PasswordReset implements LoggerAwareInterface {
*/
private $permissionCache;
*/
private $permissionCache;
- public function __construct( Config $config, AuthManager $authManager ) {
+ public function __construct(
+ Config $config,
+ AuthManager $authManager,
+ PermissionManager $permissionManager
+ ) {
$this->config = $config;
$this->authManager = $authManager;
$this->config = $config;
$this->authManager = $authManager;
+ $this->permissionManager = $permissionManager;
$this->permissionCache = new MapCacheLRU( 1 );
$this->logger = LoggerFactory::getInstance( 'authentication' );
}
$this->permissionCache = new MapCacheLRU( 1 );
$this->logger = LoggerFactory::getInstance( 'authentication' );
}
@@
-70,8
+79,6
@@
class PasswordReset implements LoggerAwareInterface {
/**
* Check if a given user has permission to use this functionality.
* @param User $user
/**
* 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
*/
* @since 1.29 Second argument for displayPassword removed.
* @return StatusValue
*/
@@
-95,7
+102,7
@@
class PasswordReset implements LoggerAwareInterface {
} elseif ( !$this->config->get( 'EnableEmail' ) ) {
// Maybe email features have been disabled
$status = StatusValue::newFatal( 'passwordreset-emaildisabled' );
} elseif ( !$this->config->get( 'EnableEmail' ) ) {
// Maybe email features have been disabled
$status = StatusValue::newFatal( 'passwordreset-emaildisabled' );
- } elseif ( !$
user->isAllowed(
'editmyprivateinfo' ) ) {
+ } elseif ( !$
this->permissionManager->userHasRight( $user,
'editmyprivateinfo' ) ) {
// Maybe not all users have permission to change private data
$status = StatusValue::newFatal( 'badaccess' );
} elseif ( $this->isBlocked( $user ) ) {
// Maybe not all users have permission to change private data
$status = StatusValue::newFatal( 'badaccess' );
} elseif ( $this->isBlocked( $user ) ) {