r9749 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r9748‎ | r9749 | r9750 >
Date:17:02, 28 June 2005
Author:kateturner
Status:old
Tags:
Comment:
(bug 2577) when [[MediaWiki:Ipboptions]] contains "-", do not show any block options,
so it looks like the old block form.
Modified paths:
  • /trunk/phase3/includes/SpecialBlockip.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialBlockip.php
@@ -42,8 +42,8 @@
4343 global $wgRequest;
4444 $this->BlockAddress = $wgRequest->getVal( 'wpBlockAddress', $wgRequest->getVal( 'ip' ) );
4545 $this->BlockReason = $wgRequest->getText( 'wpBlockReason' );
46 - $this->BlockExpiry = $wgRequest->getVal( 'wpBlockExpiry' );
47 - $this->BlockOther = $wgRequest->getVal( 'wpBlockOther' );
 46+ $this->BlockExpiry = $wgRequest->getVal( 'wpBlockExpiry', wfMsg('ipbotheroption') );
 47+ $this->BlockOther = $wgRequest->getVal( 'wpBlockOther', '' );
4848 }
4949
5050 function showForm( $err ) {
@@ -74,9 +74,13 @@
7575 $scBlockAddress = htmlspecialchars( $this->BlockAddress );
7676 $scBlockExpiry = htmlspecialchars( $this->BlockExpiry );
7777 $scBlockReason = htmlspecialchars( $this->BlockReason );
78 - $scBlockOtherTime = htmlspecialchars( $this->BlockOtherTime );
 78+ $scBlockOtherTime = htmlspecialchars( $this->BlockOther );
7979 $scBlockExpiryOptions = htmlspecialchars( wfMsg( 'ipboptions' ) );
8080
 81+ $showblockoptions = $scBlockExpiryOptions != '-';
 82+ if (!$showblockoptions)
 83+ $mIpbother = $mIpbexpiry;
 84+
8185 $blockExpiryFormOptions = "<option value=\"other\">$mIpbothertime</option>";
8286 foreach (explode(',', $scBlockExpiryOptions) as $option) {
8387 $selected = "";
@@ -96,13 +100,18 @@
97101 <input tabindex='1' type='text' size='20' name=\"wpBlockAddress\" value=\"{$scBlockAddress}\" />
98102 </td>
99103 </tr>
100 - <tr>
 104+ <tr>");
 105+ if ($showblockoptions) {
 106+ $wgOut->addHTML("
101107 <td align=\"right\">{$mIpbexpiry}:</td>
102108 <td align=\"left\">
103109 <select tabindex='2' name=\"wpBlockExpiry\">
104110 $blockExpiryFormOptions
105111 </select>
106112 </td>
 113+ ");
 114+ }
 115+ $wgOut->addHTML("
107116 </tr>
108117 <tr>
109118 <td align=\"right\">{$mIpbother}:</td>
@@ -166,9 +175,14 @@
167176 }
168177
169178 $expirestr = $this->BlockExpiry;
170 - if (strlen($expirestr) == 0 || $expirestr == wfMsg('ipbotheroption'))
 179+ if ($expirestr == wfMsg('ipbotheroption'))
171180 $expirestr = $this->BlockOther;
172181
 182+ if (strlen($expirestr) == 0) {
 183+ $this->showForm( wfMsg( 'ipb_expiry_invalid' ) );
 184+ return;
 185+ }
 186+
173187 if ( $expirestr == 'infinite' || $expirestr == 'indefinite' ) {
174188 $expiry = '';
175189 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r9746* (bug 2577) Allow sysops to enter non-standard block timeskateturner16:38, 28 June 2005

Status & tagging log