From: River Tarnell Date: Tue, 28 Jun 2005 17:02:13 +0000 (+0000) Subject: (bug 2577) when [[MediaWiki:Ipboptions]] contains "-", do not show any block options, X-Git-Tag: 1.5.0beta2~154 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=1cf715349e4c9b3b11425b0ae7f2eb0592e698bd;p=lhc%2Fweb%2Fwiklou.git (bug 2577) when [[MediaWiki:Ipboptions]] contains "-", do not show any block options, so it looks like the old block form. --- diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index 2545be154a..ea0cd046ef 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -42,8 +42,8 @@ class IPBlockForm { global $wgRequest; $this->BlockAddress = $wgRequest->getVal( 'wpBlockAddress', $wgRequest->getVal( 'ip' ) ); $this->BlockReason = $wgRequest->getText( 'wpBlockReason' ); - $this->BlockExpiry = $wgRequest->getVal( 'wpBlockExpiry' ); - $this->BlockOther = $wgRequest->getVal( 'wpBlockOther' ); + $this->BlockExpiry = $wgRequest->getVal( 'wpBlockExpiry', wfMsg('ipbotheroption') ); + $this->BlockOther = $wgRequest->getVal( 'wpBlockOther', '' ); } function showForm( $err ) { @@ -74,9 +74,13 @@ class IPBlockForm { $scBlockAddress = htmlspecialchars( $this->BlockAddress ); $scBlockExpiry = htmlspecialchars( $this->BlockExpiry ); $scBlockReason = htmlspecialchars( $this->BlockReason ); - $scBlockOtherTime = htmlspecialchars( $this->BlockOtherTime ); + $scBlockOtherTime = htmlspecialchars( $this->BlockOther ); $scBlockExpiryOptions = htmlspecialchars( wfMsg( 'ipboptions' ) ); + $showblockoptions = $scBlockExpiryOptions != '-'; + if (!$showblockoptions) + $mIpbother = $mIpbexpiry; + $blockExpiryFormOptions = ""; foreach (explode(',', $scBlockExpiryOptions) as $option) { $selected = ""; @@ -96,13 +100,18 @@ class IPBlockForm { - + "); + if ($showblockoptions) { + $wgOut->addHTML(" {$mIpbexpiry}: + "); + } + $wgOut->addHTML(" {$mIpbother}: @@ -166,9 +175,14 @@ class IPBlockForm { } $expirestr = $this->BlockExpiry; - if (strlen($expirestr) == 0 || $expirestr == wfMsg('ipbotheroption')) + if ($expirestr == wfMsg('ipbotheroption')) $expirestr = $this->BlockOther; + if (strlen($expirestr) == 0) { + $this->showForm( wfMsg( 'ipb_expiry_invalid' ) ); + return; + } + if ( $expirestr == 'infinite' || $expirestr == 'indefinite' ) { $expiry = ''; } else {