BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
PasswordReset Class Reference
Inheritance diagram for PasswordReset:
Collaboration diagram for PasswordReset:

Public Member Functions

 __construct (Config $config, AuthManager $authManager)
 
 setLogger (LoggerInterface $logger)
 
 isAllowed (User $user)
 
 execute (User $performingUser, $username=null, $email=null)
 

Protected Member Functions

 isBlocked (User $user)
 
 getUsersByEmail ($email)
 

Protected Attributes

 $config
 
 $authManager
 
 $logger
 

Detailed Description

Helper class for the password reset functionality shared by the web UI and the API.

Requires the TemporaryPasswordPrimaryAuthenticationProvider and the EmailNotificationSecondaryAuthenticationProvider (or something providing equivalent functionality) to be enabled.

Member Function Documentation

PasswordReset::execute ( User  $performingUser,
  $username = null,
  $email = null 
)

Do a password reset. Authorization is the caller's responsibility.

Process the form. At this point we know that the user passes all the criteria in userCanExecute(), and if the data array contains 'Username', etc, then Username resets are allowed.

Since
1.29 Fourth argument for displayPassword removed.
Parameters
User$performingUserThe user that does the password reset
string$usernameThe user whose password is reset
string$emailAlternative way to specify the user
Returns
StatusValue Will contain the passwords as a username => password array if the $displayPassword flag was set
Exceptions
LogicExceptionWhen the user is not allowed to perform the action
MWExceptionOn unexpected DB errors
PasswordReset::getUsersByEmail (   $email)
protected
Parameters
string$email
Returns
User[]
Exceptions
MWExceptionOn unexpected database errors
PasswordReset::isAllowed ( User  $user)

Check if a given user has permission to use this functionality.

Parameters
User$user
bool$displayPasswordIf 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.
Returns
StatusValue
PasswordReset::isBlocked ( User  $user)
protected

Check whether the user is blocked. Ignores certain types of system blocks that are only meant to force users to log in.

Parameters
User$user
Returns
bool
Since
1.30
PasswordReset::setLogger ( LoggerInterface  $logger)

Set the logger instance to use.

Parameters
LoggerInterface$logger
Since
1.29

Implements Psr\Log\LoggerAwareInterface.


The documentation for this class was generated from the following file: