*/
use MediaWiki\Block\DatabaseBlock;
+use MediaWiki\MediaWikiServices;
/**
* A special page for unblocking users
$this->setHeaders();
$this->outputHeader();
+ $this->addHelpLink( 'Help:Blocking users' );
$out = $this->getOutput();
$out->setPageTitle( $this->msg( 'unblockip' ) );
* Submit callback for an HTMLForm object
* @param array $data
* @param HTMLForm $form
- * @return array|bool Array(message key, parameters)
+ * @return array|bool [ message key, parameters ]
*/
public static function processUIUnblock( array $data, HTMLForm $form ) {
return self::processUnblock( $data, $form->getContext() );
* @param array $data
* @param IContextSource $context
* @throws ErrorPageError
- * @return array|bool Array( Array( message key, parameters ) ) on failure, True on success
+ * @return array|bool [ [ message key, parameters ] ] on failure, True on success
*/
public static function processUnblock( array $data, IContextSource $context ) {
$performer = $context->getUser();
# If the name was hidden and the blocking user cannot hide
# names, then don't allow any block removals...
- if ( !$performer->isAllowed( 'hideuser' ) && $block->getHideName() ) {
+ if ( !MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasRight( $performer, 'hideuser' ) && $block->getHideName()
+ ) {
return [ 'unblock-hideuser' ];
}
$logEntry->setComment( $data['Reason'] );
$logEntry->setPerformer( $performer );
if ( isset( $data['Tags'] ) ) {
- $logEntry->setTags( $data['Tags'] );
+ $logEntry->addTags( $data['Tags'] );
}
$logEntry->setRelations( [ 'ipb_id' => $block->getId() ] );
$logId = $logEntry->insert();