protected function getFormFields() {
global $wgAuth;
$resetRoutes = $this->getConfig()->get( 'PasswordResetRoutes' );
protected function getFormFields() {
global $wgAuth;
$resetRoutes = $this->getConfig()->get( 'PasswordResetRoutes' );
'type' => 'check',
'label-message' => 'passwordreset-capture',
'help-message' => 'passwordreset-capture-help',
'type' => 'check',
'label-message' => 'passwordreset-capture',
'help-message' => 'passwordreset-capture-help',
- $error = array();
- if ( !Hooks::run( 'SpecialPasswordResetOnSubmit', array( &$users, $data, &$error ) ) ) {
- return array( $error );
+ $error = [];
+ if ( !Hooks::run( 'SpecialPasswordResetOnSubmit', [ &$users, $data, &$error ] ) ) {
+ return [ $error ];
'throttled-mailpassword',
round( $this->getConfig()->get( 'PasswordReminderResendTime' ), 3 )
'throttled-mailpassword',
round( $this->getConfig()->get( 'PasswordReminderResendTime' ), 3 )
}
}
// All the users will have the same email address
if ( $firstUser->getEmail() == '' ) {
// This won't be reachable from the email route, so safe to expose the username
}
}
// All the users will have the same email address
if ( $firstUser->getEmail() == '' ) {
// This won't be reachable from the email route, so safe to expose the username
}
// We need to have a valid IP address for the hook, but per bug 18347, we should
// send the user's name if they're logged in.
$ip = $this->getRequest()->getIP();
if ( !$ip ) {
}
// We need to have a valid IP address for the hook, but per bug 18347, we should
// send the user's name if they're logged in.
$ip = $this->getRequest()->getIP();
if ( !$ip ) {
- Hooks::run( 'User::mailPasswordInternal', array( &$caller, &$ip, &$firstUser ) );
+ Hooks::run( 'User::mailPasswordInternal', [ &$caller, &$ip, &$firstUser ] );
$username = $caller->getName();
$msg = IP::isValid( $username )
? 'passwordreset-emailtext-ip'
$username = $caller->getName();
$msg = IP::isValid( $username )
? 'passwordreset-emailtext-ip'
// Send in the user's language; which should hopefully be the same
$userLanguage = $firstUser->getOption( 'language' );
// Send in the user's language; which should hopefully be the same
$userLanguage = $firstUser->getOption( 'language' );
foreach ( $users as $user ) {
$password = PasswordFactory::generateRandomPasswordString( $wgMinimalPasswordLength );
$user->setNewpassword( $password );
foreach ( $users as $user ) {
$password = PasswordFactory::generateRandomPasswordString( $wgMinimalPasswordLength );
$user->setNewpassword( $password );
// @todo FIXME: The email wasn't sent, but we have already set
// the password throttle timestamp, so they won't be able to try
// again until it expires... :(
// @todo FIXME: The email wasn't sent, but we have already set
// the password throttle timestamp, so they won't be able to try
// again until it expires... :(