$out = $this->getOutput();
$out->setPageTitle( $this->msg( 'unblockip' ) );
+ $out->addModules( [ 'mediawiki.userSuggest' ] );
$form = HTMLForm::factory( 'ooui', $this->getFields(), $this->getContext() );
$form->setWrapperLegendMsg( 'unblockip' );
protected function getFields() {
$fields = [
'Target' => [
- 'type' => 'user',
+ 'type' => 'text',
'label-message' => 'ipaddressorusername',
'autofocus' => true,
'size' => '45',
'required' => true,
+ 'cssclass' => 'mw-autocomplete-user', // used by mediawiki.userSuggest
],
'Name' => [
'type' => 'info',
# If the name was hidden and the blocking user cannot hide
# names, then don't allow any block removals...
- if ( !$performer->isAllowed( 'hideuser' ) && $block->mHideName ) {
+ if ( !$performer->isAllowed( 'hideuser' ) && $block->getHideName() ) {
return [ 'unblock-hideuser' ];
}
Hooks::run( 'UnblockUserComplete', [ $block, $performer ] );
# Unset _deleted fields as needed
- if ( $block->mHideName ) {
+ if ( $block->getHideName() ) {
# Something is deeply FUBAR if this is not a User object, but who knows?
$id = $block->getTarget() instanceof User
? $block->getTarget()->getId()
if ( isset( $data['Tags'] ) ) {
$logEntry->setTags( $data['Tags'] );
}
+ $logEntry->setRelations( [ 'ipb_id' => $block->getId() ] );
$logId = $logEntry->insert();
$logEntry->publish( $logId );