From 9e0989bc1689c8ee0ac057164fc6399a8e512d80 Mon Sep 17 00:00:00 2001 From: Alex Z Date: Sun, 18 Jan 2009 02:57:54 +0000 Subject: [PATCH] (bug 17045) Prefill the block form with the options of the existing block when modifying an existing block --- RELEASE-NOTES | 2 ++ includes/specials/SpecialBlockip.php | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 456e9b852b..98cb48c046 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -39,6 +39,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN of Service page, for example * Add new hook 'UserLoadFromDatabase' that is called while loading a user from the database. +* (bug 17045) Options on the block form are prefilled with the options of the + existing block when modifying an existing block. === Bug fixes in 1.15 === * (bug 16968) Special:Upload no longer throws useless warnings. diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index c7e7c54179..3c305ad4f9 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -106,6 +106,15 @@ class IPBlockForm { ( $currentBlock->mAddress == $this->BlockAddress ) ) ) { $wgOut->addWikiMsg( 'ipb-needreblock', $this->BlockAddress ); $alreadyBlocked = true; + # Set the block form settings to the existing block + $this->BlockAnonOnly = $currentBlock->mAnonOnly; + $this->BlockCreateAccount = $currentBlock->mCreateAccount; + $this->BlockEnableAutoblock = $currentBlock->mEnableAutoblock; + $this->BlockEmail = $currentBlock->mBlockEmail; + $this->BlockHideName = $currentBlock->mHideName; + $this->BlockAllowUsertalk = $currentBlock->mAllowUsertalk; + $this->BlockOther = wfTimestamp( TS_RFC2822, $currentBlock->mExpiry ); + $this->BlockReason = $currentBlock->mReason; } } -- 2.20.1