Index: trunk/phase3/includes/SpecialBlockip.php |
— | — | @@ -43,6 +43,7 @@ |
44 | 44 | $this->BlockAddress = $wgRequest->getVal( 'wpBlockAddress', $wgRequest->getVal( 'ip' ) ); |
45 | 45 | $this->BlockReason = $wgRequest->getText( 'wpBlockReason' ); |
46 | 46 | $this->BlockExpiry = $wgRequest->getVal( 'wpBlockExpiry' ); |
| 47 | + $this->BlockOther = $wgRequest->getVal( 'wpBlockOther' ); |
47 | 48 | } |
48 | 49 | |
49 | 50 | function showForm( $err ) { |
— | — | @@ -58,6 +59,8 @@ |
59 | 60 | $mIpaddress = htmlspecialchars( wfMsg( 'ipaddress' ) ); |
60 | 61 | } |
61 | 62 | $mIpbexpiry = htmlspecialchars( wfMsg( 'ipbexpiry' ) ); |
| 63 | + $mIpbother = htmlspecialchars( wfMsg( 'ipbother' ) ); |
| 64 | + $mIpbothertime = htmlspecialchars( wfMsg( 'ipbotheroption' ) ); |
62 | 65 | $mIpbreason = htmlspecialchars( wfMsg( 'ipbreason' ) ); |
63 | 66 | $mIpbsubmit = htmlspecialchars( wfMsg( 'ipbsubmit' ) ); |
64 | 67 | $titleObj = Title::makeTitle( NS_SPECIAL, 'Blockip' ); |
— | — | @@ -71,10 +74,16 @@ |
72 | 75 | $scBlockAddress = htmlspecialchars( $this->BlockAddress ); |
73 | 76 | $scBlockExpiry = htmlspecialchars( $this->BlockExpiry ); |
74 | 77 | $scBlockReason = htmlspecialchars( $this->BlockReason ); |
| 78 | + $scBlockOtherTime = htmlspecialchars( $this->BlockOtherTime ); |
| 79 | + $scBlockExpiryOptions = htmlspecialchars( wfMsg( 'ipboptions' ) ); |
75 | 80 | |
76 | | - $blockExpiryFormOptions = '<option>' . |
77 | | - implode("</option>\n\t\t\t\t\t<option>", explode(',', $wgBlockExpiryOptions)) . |
78 | | - '</option>'; |
| 81 | + $blockExpiryFormOptions = "<option value=\"other\">$mIpbothertime</option>"; |
| 82 | + foreach (explode(',', $scBlockExpiryOptions) as $option) { |
| 83 | + $selected = ""; |
| 84 | + if ($this->BlockExpiry === $option) |
| 85 | + $selected = ' selected="selected"'; |
| 86 | + $blockExpiryFormOptions .= "<option$selected>$option</option>"; |
| 87 | + } |
79 | 88 | |
80 | 89 | $token = htmlspecialchars( $wgUser->editToken() ); |
81 | 90 | |
— | — | @@ -96,6 +105,12 @@ |
97 | 106 | </td> |
98 | 107 | </tr> |
99 | 108 | <tr> |
| 109 | + <td align=\"right\">{$mIpbother}:</td> |
| 110 | + <td align=\"left\"> |
| 111 | + <input tabindex='3' type='text' size='40' name=\"wpBlockOther\" value=\"{$scBlockOtherTime}\" /> |
| 112 | + </td> |
| 113 | + </tr> |
| 114 | + <tr> |
100 | 115 | <td align=\"right\">{$mIpbreason}:</td> |
101 | 116 | <td align=\"left\"> |
102 | 117 | <input tabindex='3' type='text' size='40' name=\"wpBlockReason\" value=\"{$scBlockReason}\" /> |
— | — | @@ -150,11 +165,15 @@ |
151 | 166 | } |
152 | 167 | } |
153 | 168 | |
154 | | - if ( $this->BlockExpiry == 'infinite' || $this->BlockExpiry == 'indefinite' ) { |
| 169 | + $expirestr = $this->BlockExpiry; |
| 170 | + if (strlen($expirestr) == 0 || $expirestr == wfMsg('ipbotheroption')) |
| 171 | + $expirestr = $this->BlockOther; |
| 172 | + |
| 173 | + if ( $expirestr == 'infinite' || $expirestr == 'indefinite' ) { |
155 | 174 | $expiry = ''; |
156 | 175 | } else { |
157 | 176 | # Convert GNU-style date, returns -1 on error |
158 | | - $expiry = strtotime( $this->BlockExpiry ); |
| 177 | + $expiry = strtotime( $expirestr ); |
159 | 178 | |
160 | 179 | if ( $expiry < 0 ) { |
161 | 180 | $this->showForm( wfMsg( 'ipb_expiry_invalid' ) ); |
— | — | @@ -180,7 +199,7 @@ |
181 | 200 | # Make log entry |
182 | 201 | $log = new LogPage( 'block' ); |
183 | 202 | $log->addEntry( 'block', Title::makeTitle( NS_USER, $this->BlockAddress ), |
184 | | - $this->BlockReason, $this->BlockExpiry ); |
| 203 | + $this->BlockReason, $expirestr ); |
185 | 204 | |
186 | 205 | # Report to the user |
187 | 206 | $titleObj = Title::makeTitle( NS_SPECIAL, 'Blockip' ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -401,8 +401,8 @@ |
402 | 402 | * Don't show bogus messages about watchlist notifications when disabled |
403 | 403 | * Don't show old debug messages in watchlist |
404 | 404 | * (bug 2576) Fix recording of transclusion links |
| 405 | +* (bug 2577) Allow sysops to enter non-standard block times |
405 | 406 | |
406 | | - |
407 | 407 | === Caveats === |
408 | 408 | |
409 | 409 | Some output, particularly involving user-supplied inline HTML, may not |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -1400,6 +1400,9 @@ |
1401 | 1401 | 'ipbexpiry' => 'Expiry', |
1402 | 1402 | 'ipbreason' => 'Reason', |
1403 | 1403 | 'ipbsubmit' => 'Block this user', |
| 1404 | +'ipbother' => 'Other time', |
| 1405 | +'ipboptions' => '2 hours,1 day,3 days,1 week,2 weeks,1 month,3 months,6 months,1 year,infinite', |
| 1406 | +'ipbotheroption' => 'other', |
1404 | 1407 | 'badipaddress' => 'Invalid IP address', |
1405 | 1408 | 'blockipsuccesssub' => 'Block succeeded', |
1406 | 1409 | 'blockipsuccesstext' => "\"$1\" has been blocked. |