$status = self::checkUnblockSelf( $this->target, $user );
if ( $status !== true ) {
throw new ErrorPageError( 'badaccess', $status );
$status = self::checkUnblockSelf( $this->target, $user );
if ( $status !== true ) {
throw new ErrorPageError( 'badaccess', $status );
/**
* If the user has already been blocked with similar settings, load that block
* and change the defaults for the form fields to match the existing settings.
/**
* If the user has already been blocked with similar settings, load that block
* and change the defaults for the form fields to match the existing settings.
if ( !$block->mHideName || $this->getUser()->isAllowed( 'hideuser' ) ) {
$fields['Reason']['default'] = $block->mReason;
} else {
if ( !$block->mHideName || $this->getUser()->isAllowed( 'hideuser' ) ) {
$fields['Reason']['default'] = $block->mReason;
} else {
* @param string $par Subpage parameter passed to setup, or data value from
* the HTMLForm
* @param WebRequest $request Optionally try and get data from a request too
* @param string $par Subpage parameter passed to setup, or data value from
* the HTMLForm
* @param WebRequest $request Optionally try and get data from a request too
$block->mExpiry = $expiryTime;
$block->prevents( 'createaccount', $data['CreateAccount'] );
$block->prevents( 'editownusertalk', ( !$wgBlockAllowsUTEdit || $data['DisableUTEdit'] ) );
$block->mExpiry = $expiryTime;
$block->prevents( 'createaccount', $data['CreateAccount'] );
$block->prevents( 'editownusertalk', ( !$wgBlockAllowsUTEdit || $data['DisableUTEdit'] ) );
$blockNotConfirmed = !$data['Confirm'] || ( array_key_exists( 'PreviousTarget', $data )
&& $data['PreviousTarget'] !== $target );
$blockNotConfirmed = !$data['Confirm'] || ( array_key_exists( 'PreviousTarget', $data )
&& $data['PreviousTarget'] !== $target );
$reblockNotAllowed = ( array_key_exists( 'Reblock', $data ) && !$data['Reblock'] );
# Show form unless the user is already aware of this...
$reblockNotAllowed = ( array_key_exists( 'Reblock', $data ) && !$data['Reblock'] );
# Show form unless the user is already aware of this...
$logEntry->setComment( $data['Reason'][0] );
$logEntry->setPerformer( $performer );
$logEntry->setParameters( $logParams );
$logEntry->setComment( $data['Reason'][0] );
$logEntry->setPerformer( $performer );
$logEntry->setParameters( $logParams );
$blockIds = array_merge( [ $status['id'] ], $status['autoIds'] );
$logEntry->setRelations( [ 'ipb_id' => $blockIds ] );
$logId = $logEntry->insert();
$blockIds = array_merge( [ $status['id'] ], $status['autoIds'] );
$logEntry->setRelations( [ 'ipb_id' => $blockIds ] );
$logId = $logEntry->insert();
* others, and probably shouldn't be able to unblock themselves
* either.
* @param User|int|string $user
* others, and probably shouldn't be able to unblock themselves
* either.
* @param User|int|string $user