X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUnblock.php;h=a04fe4e16d6ab61b829be1688d01ce9c4220de28;hb=f2b01310d90060ba2ccba3e6d36b67e942bff978;hp=fe9202e4a99d5a0fb9ada2bfba1b9bf433e8bad3;hpb=c2f9376c19335219d403e602496fa44f4a3e7b55;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUnblock.php b/includes/specials/SpecialUnblock.php index fe9202e4a9..a04fe4e16d 100644 --- a/includes/specials/SpecialUnblock.php +++ b/includes/specials/SpecialUnblock.php @@ -57,6 +57,7 @@ class SpecialUnblock extends SpecialPage { $out = $this->getOutput(); $out->setPageTitle( $this->msg( 'unblockip' ) ); + $out->addModules( [ 'mediawiki.userSuggest' ] ); $form = HTMLForm::factory( 'ooui', $this->getFields(), $this->getContext() ); $form->setWrapperLegendMsg( 'unblockip' ); @@ -86,11 +87,12 @@ class SpecialUnblock extends SpecialPage { 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', @@ -203,7 +205,7 @@ class SpecialUnblock extends SpecialPage { # 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' ]; } @@ -220,7 +222,7 @@ class SpecialUnblock extends SpecialPage { 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() @@ -246,6 +248,7 @@ class SpecialUnblock extends SpecialPage { if ( isset( $data['Tags'] ) ) { $logEntry->setTags( $data['Tags'] ); } + $logEntry->setRelations( [ 'ipb_id' => $block->getId() ] ); $logId = $logEntry->insert(); $logEntry->publish( $logId );