MediaWiki master
MediaWiki\RenameUser\RenameUser Class Reference

Handles the backend logic of renaming users. More...

Public Member Functions

 __construct (private readonly ServiceOptions $options, private readonly CentralIdLookupFactory $centralIdLookupFactory, private readonly JobQueueGroupFactory $jobQueueGroupFactory, private readonly MovePageFactory $movePageFactory, private readonly UserFactory $userFactory, private readonly UserNameUtils $userNameUtils, private readonly PermissionManager $permissionManager, private readonly TitleFactory $titleFactory, User $performer, User $target, string $oldName, string $newName, string $reason, array $renameOptions)
 Valid options for $renameOptions:
 moveUserPages ()
 Attempts to move local user pages.
 rename ()
 Attempts to perform the rename smartly after checking the performer's rights.
 renameGlobal ()
 Attempts to perform the rename globally.
 renameLocal ()
 Performs the rename in local domain.
 renameUnsafe ()
 Attempts to perform the rename smartly.

Public Attributes

const CONSTRUCTOR_OPTIONS

Detailed Description

Handles the backend logic of renaming users.

Since
1.44

Definition at line 29 of file RenameUser.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\RenameUser\RenameUser::__construct ( private readonly ServiceOptions $options,
private readonly CentralIdLookupFactory $centralIdLookupFactory,
private readonly JobQueueGroupFactory $jobQueueGroupFactory,
private readonly MovePageFactory $movePageFactory,
private readonly UserFactory $userFactory,
private readonly UserNameUtils $userNameUtils,
private readonly PermissionManager $permissionManager,
private readonly TitleFactory $titleFactory,
User $performer,
User $target,
string $oldName,
string $newName,
string $reason,
array $renameOptions )

Valid options for $renameOptions:

  • forceGlobalDetach : Force to detach from CentralAuth
  • movePages : Whether user pages should be moved
  • suppressRedirect : Whether to suppress redirects for user pages
  • derived : Whether shared tables should be updated If derived is true, it is assumed that all shared tables have been updated.

Definition at line 68 of file RenameUser.php.

Member Function Documentation

◆ moveUserPages()

MediaWiki\RenameUser\RenameUser::moveUserPages ( )

Attempts to move local user pages.

Returns
Status

Definition at line 212 of file RenameUser.php.

References if, and NS_USER.

◆ rename()

MediaWiki\RenameUser\RenameUser::rename ( )

Attempts to perform the rename smartly after checking the performer's rights.

This decides whether renameGlobal or renameLocal should be used and call the proper function.

Returns
Status

Definition at line 353 of file RenameUser.php.

References if.

◆ renameGlobal()

MediaWiki\RenameUser\RenameUser::renameGlobal ( )

Attempts to perform the rename globally.

Note
This method doesn't check user permissions. Use 'rename' for that.

This will first call renameLocal to complete local renaming, then enqueue RenameUserDerivedJob for all other wikis in the same wiki family.

Returns
Status

Definition at line 281 of file RenameUser.php.

References if.

Referenced by renameUnsafe().

◆ renameLocal()

MediaWiki\RenameUser\RenameUser::renameLocal ( )

Performs the rename in local domain.

Returns
Status

Definition at line 167 of file RenameUser.php.

References if.

◆ renameUnsafe()

MediaWiki\RenameUser\RenameUser::renameUnsafe ( )

Attempts to perform the rename smartly.

Note
This method doesn't check user permissions. Use 'rename' for that.

This decides whether renameGlobal or renameLocal should be used and call the proper function.

Returns
Status

Definition at line 337 of file RenameUser.php.

References if, and renameGlobal().

Member Data Documentation

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\RenameUser\RenameUser::CONSTRUCTOR_OPTIONS
Initial value:
= [
]
const LocalDatabases
Name constant for the LocalDatabases setting, for use with Config\get().
Access: internal
For use by RenameUserFactory

Definition at line 56 of file RenameUser.php.


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