|
MediaWiki master
|
Class which performs the actual renaming of users. More...
Public Member Functions | |
| __construct (string $old, string $new, int $uid, User $renamer, $options=[]) | |
| Constructor. | |
| rename () | |
| Do the rename operation. | |
| renameUser () | |
| Do the rename operation. | |
Static Public Member Functions | |
| static | isPreviouslyRenamedAccount (string $username, IReadableDatabase $db) |
| This method does not check log_deleted, and thus will reveal the existence of hidden rename log entries. | |
Public Attributes | |
| bool | $checkIfUserExists |
| Flag that can be set to false, in case another process has already started the updates and the old username may have already been renamed in the user table. | |
| string | $new |
| The new username of the user being renamed. | |
| string | $old |
| The old username of the user being renamed. | |
| array | $tables |
| The [ tables => fields ] to be updated. | |
| array[] | $tablesJob |
| [ tables => fields ] to be updated in a deferred job | |
| int | $uid |
| The user ID of the user being renamed. | |
| const | NAME_COL = 0 |
| const | TIME_COL = 2 |
| const | UID_COL = 1 |
Protected Member Functions | |
| debug (string $msg) | |
Class which performs the actual renaming of users.
Definition at line 27 of file RenameuserSQL.php.
| MediaWiki\RenameUser\RenameuserSQL::__construct | ( | string | $old, |
| string | $new, | ||
| int | $uid, | ||
| User | $renamer, | ||
| $options = [] ) |
Constructor.
| string | $old | The old username |
| string | $new | The new username |
| int | $uid | |
| User | $renamer | |
| array | $options | Optional extra options. 'reason' - string, reason for the rename 'debugPrefix' - string, prefixed to debug messages 'checkIfUserExists' - bool, whether to update the user table 'derived' - bool, whether to skip updates to shared tables |
Definition at line 140 of file RenameuserSQL.php.
References MediaWiki\RenameUser\RenameuserSQL\$new, MediaWiki\RenameUser\RenameuserSQL\$old, MediaWiki\RenameUser\RenameuserSQL\$uid, MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\MainConfigNames\UpdateRowsPerJob.
|
protected |
Definition at line 180 of file RenameuserSQL.php.
Referenced by MediaWiki\RenameUser\RenameuserSQL\renameUser().
|
static |
This method does not check log_deleted, and thus will reveal the existence of hidden rename log entries.
This seems unavoidable: we have to reveal that the username can't be registered when someone tries to register it, and there is no other plausible error message we could give. Please review whether that's appropriate for your use case when calling it.
Definition at line 491 of file RenameuserSQL.php.
| MediaWiki\RenameUser\RenameuserSQL::rename | ( | ) |
Do the rename operation.
Definition at line 192 of file RenameuserSQL.php.
References MediaWiki\RenameUser\RenameuserSQL\renameUser(), and wfDeprecated().
| MediaWiki\RenameUser\RenameuserSQL::renameUser | ( | ) |
Do the rename operation.
Definition at line 201 of file RenameuserSQL.php.
References MediaWiki\RenameUser\RenameuserSQL\$old, and MediaWiki\RenameUser\RenameuserSQL\debug().
Referenced by MediaWiki\RenameUser\RenameuserSQL\rename().
| bool MediaWiki\RenameUser\RenameuserSQL::$checkIfUserExists |
Flag that can be set to false, in case another process has already started the updates and the old username may have already been renamed in the user table.
Definition at line 69 of file RenameuserSQL.php.
| string MediaWiki\RenameUser\RenameuserSQL::$new |
The new username of the user being renamed.
Definition at line 40 of file RenameuserSQL.php.
Referenced by MediaWiki\RenameUser\RenameuserSQL\__construct().
| string MediaWiki\RenameUser\RenameuserSQL::$old |
The old username of the user being renamed.
Definition at line 33 of file RenameuserSQL.php.
Referenced by MediaWiki\RenameUser\RenameuserSQL\__construct(), and MediaWiki\RenameUser\RenameuserSQL\renameUser().
| array MediaWiki\RenameUser\RenameuserSQL::$tables |
The [ tables => fields ] to be updated.
Definition at line 54 of file RenameuserSQL.php.
| array [] MediaWiki\RenameUser\RenameuserSQL::$tablesJob |
[ tables => fields ] to be updated in a deferred job
Definition at line 61 of file RenameuserSQL.php.
| int MediaWiki\RenameUser\RenameuserSQL::$uid |
The user ID of the user being renamed.
Definition at line 47 of file RenameuserSQL.php.
Referenced by MediaWiki\RenameUser\RenameuserSQL\__construct().
| const MediaWiki\RenameUser\RenameuserSQL::NAME_COL = 0 |
Definition at line 102 of file RenameuserSQL.php.
| const MediaWiki\RenameUser\RenameuserSQL::TIME_COL = 2 |
Definition at line 104 of file RenameuserSQL.php.
| const MediaWiki\RenameUser\RenameuserSQL::UID_COL = 1 |
Definition at line 103 of file RenameuserSQL.php.