/**
  * When renaming an account, ensure that the presence records are updated.
  * @param $userId int
  * @param $oldName string
  * @param $newName string
  * @return bool
  */
 static function onRenameUserComplete($userId, $oldName, $newName)
 {
     $oldCentral = new CentralAuthUser($oldName);
     $newCentral = new CentralAuthUser($newName);
     if ($newCentral->exists() && $oldCentral->renameInProgressOn(wfWikiID())) {
         // This is a global rename, just update the row.
         $oldCentral->updateLocalName(wfWikiID(), $newName);
     } else {
         $oldCentral->removeLocalName(wfWikiID());
         $newCentral->addLocalName(wfWikiID());
     }
     return true;
 }
Пример #2
0
 /**
  * When renaming an account, ensure that the presence records are updated.
  * @param $userId
  * @param $oldName
  * @param $newName
  * @return bool
  */
 static function onRenameUserComplete($userId, $oldName, $newName)
 {
     $oldCentral = new CentralAuthUser($oldName);
     $oldCentral->removeLocalName(wfWikiID());
     $newCentral = new CentralAuthUser($newName);
     $newCentral->addLocalName(wfWikiID());
     return true;
 }