47 public function run() {
48 $oldName = $this->params[
'oldname'];
49 $newName = $this->params[
'newname'];
50 $uid = $this->params[
'uid'];
51 $performerUid = $this->params[
'performer'];
52 $reason = $this->params[
'reason'];
53 $movePages = $this->params[
'movePages'] ??
true;
54 $suppressRedirect = $this->params[
'suppressRedirect'] ??
false;
56 $user = $this->userFactory->newFromId( $uid );
57 $performer = $this->userFactory->newFromId( $performerUid );
58 $logger = LoggerFactory::getInstance(
'RenameUser' );
61 if ( !$this->userFactory->isUserTableShared() ) {
64 if ( $user->getName() !== $newName ) {
66 "User to be renamed from $oldName to $newName does not have the expected name, skipping"
72 $rename = $this->renameUserFactory->newDerivedRenameUser(
79 'movePages' => $movePages,
80 'suppressRedirect' => $suppressRedirect
83 $status = $rename->renameLocal();
84 if ( !$status->isGood() ) {
86 "Cannot finish derived local user rename from $oldName to $newName: $status"
90 return $status->isOK();