* or as subpage (Special:Block/Foo) */
protected $target;
- /// @var Block::TYPE_ constant
+ /** @var Integer Block::TYPE_ constant */
protected $type;
- /// @var User|String the previous block target
+ /** @var User|String the previous block target */
protected $previousTarget;
- /// @var Bool whether the previous submission of the form asked for HideUser
+ /** @var Bool whether the previous submission of the form asked for HideUser */
protected $requestedHideUser;
- /// @var Bool
+ /** @var Bool */
protected $alreadyBlocked;
- /// @var Array
+ /** @var Array */
protected $preErrors = array();
public function __construct() {
/**
* Given the form data, actually implement a block
- * @param $data Array
- * @param $context IContextSource
+ * @param $data Array
+ * @param $context IContextSource
* @return Bool|String
*/
public static function processForm( array $data, IContextSource $context ) {
$block->isAutoblocking( $data['AutoBlock'] );
$block->mHideName = $data['HideUser'];
- if ( !wfRunHooks( 'BlockIp', array( &$block, &$performer ) ) ) {
- return array( 'hookaborted' );
+ $reason = array( 'hookaborted' );
+ if ( !wfRunHooks( 'BlockIp', array( &$block, &$performer, &$reason ) ) ) {
+ return $reason;
}
# Try to insert block. Is there a conflicting block?
return array( 'cant-see-hidden-user' );
}
- $currentBlock->delete();
- $status = $block->insert();
+ $currentBlock->isHardblock( $block->isHardblock() );
+ $currentBlock->prevents( 'createaccount', $block->prevents( 'createaccount' ) );
+ $currentBlock->mExpiry = $block->mExpiry;
+ $currentBlock->isAutoblocking( $block->isAutoblocking() );
+ $currentBlock->mHideName = $block->mHideName;
+ $currentBlock->prevents( 'sendemail', $block->prevents( 'sendemail' ) );
+ $currentBlock->prevents( 'editownusertalk', $block->prevents( 'editownusertalk' ) );
+ $currentBlock->mReason = $block->mReason;
+
+ $status = $currentBlock->update();
+
$logaction = 'reblock';
# Unset _deleted fields if requested
/**
* Process the form on POST submission.
- * @param $data Array
+ * @param $data Array
* @return Bool|Array true for success, false for didn't-try, array of errors on failure
*/
public function onSubmit( array $data ) {