MediaWiki master
MediaWiki\RenameUser\RenameUser Class Reference

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

Public Member Functions

 __construct (ServiceOptions $options, CentralIdLookupFactory $centralIdLookupFactory, JobQueueGroupFactory $jobQueueGroupFactory, MovePageFactory $movePageFactory, UserFactory $userFactory, UserNameUtils $userNameUtils, PermissionManager $permissionManager, TitleFactory $titleFactory, User $performer, User $target, string $oldName, string $newName, string $reason, array $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 ( ServiceOptions $options,
CentralIdLookupFactory $centralIdLookupFactory,
JobQueueGroupFactory $jobQueueGroupFactory,
MovePageFactory $movePageFactory,
UserFactory $userFactory,
UserNameUtils $userNameUtils,
PermissionManager $permissionManager,
TitleFactory $titleFactory,
User $performer,
User $target,
string $oldName,
string $newName,
string $reason,
array $renameOptions )
Parameters
ServiceOptions$options
CentralIdLookupFactory$centralIdLookupFactory
JobQueueGroupFactory$jobQueueGroupFactory
MovePageFactory$movePageFactory
UserFactory$userFactory
UserNameUtils$userNameUtils
PermissionManager$permissionManager
TitleFactory$titleFactory
User$performer
User$target
string$oldName
string$newName
string$reason
array$renameOptionsValid options:
  • 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 91 of file RenameUser.php.

References MediaWiki\Config\ServiceOptions\assertRequiredOptions(), MediaWiki\Config\ServiceOptions\get(), and MediaWiki\MainConfigNames\LocalDatabases.

Member Function Documentation

◆ moveUserPages()

MediaWiki\RenameUser\RenameUser::moveUserPages ( )

Attempts to move local user pages.

Returns
Status

Definition at line 244 of file RenameUser.php.

References 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 385 of file RenameUser.php.

◆ 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 313 of file RenameUser.php.

◆ renameLocal()

MediaWiki\RenameUser\RenameUser::renameLocal ( )

Performs the rename in local domain.

Returns
Status

Definition at line 199 of file RenameUser.php.

◆ 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 369 of file RenameUser.php.

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 63 of file RenameUser.php.


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