function onSubmit(array $data) { if (!isset($data['username'])) { $this->showCurrentRenames(); return false; } $name = User::getCanonicalName($data['username'], 'usable'); if (!$name) { $this->showCurrentRenames(); return false; } $out = $this->getOutput(); $this->renameuserStatus = new GlobalRenameUserStatus($name); $names = $this->renameuserStatus->getNames(); if (!$names) { $this->checkCachePurge($name); $out->addWikiMsg('centralauth-rename-notinprogress', $name); $this->getForm()->displayForm(false); $this->showLogExtract($name); return true; } list($oldName, $newName) = $names; $statuses = $this->renameuserStatus->getStatuses(); $this->getForm()->displayForm(false); // $newname will always be defined since we check // for 0 result rows above $caUser = new CentralAuthUser($newName); $attached = $caUser->listAttached(); foreach ($attached as $wiki) { // If it's not in the db table, and there is // an attached acount, assume it's done. if (!isset($statuses[$wiki])) { $statuses[$wiki] = 'done'; } } ksort($statuses); $table = Html::openElement('table', array('class' => 'wikitable sortable')); $table .= Html::openElement('tr'); $table .= Html::element('th', array(), $this->msg('centralauth-rename-table-domain')->text()); $table .= Html::element('th', array(), $this->msg('centralauth-rename-table-status')->text()); $table .= Html::closeElement('tr'); foreach ($statuses as $wiki => $status) { $table .= Html::openElement('tr'); $table .= Html::element('td', array(), WikiMap::getWiki($wiki)->getDisplayName()); // Messages used: centralauth-rename-table-status-inprogress // centralauth-rename-table-status-queued, centralauth-rename-table-status-done $table .= Html::rawElement('td', array(), $this->msg("centralauth-rename-table-status-{$status}")->parse()); $table .= Html::closeElement('tr'); } $table .= Html::closeElement('table'); $fieldset = Xml::fieldset($this->msg('centralauth-rename-progress-fieldset')->text(), $table); $this->showLogExtract($newName); $out->addHTML($fieldset); return true; }