| Index: trunk/phase3/includes/SpecialBlockip.php |
| — | — | @@ -46,16 +46,12 @@ |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | function showForm( $err ) { |
| 50 | | - global $wgOut, $wgUser, $wgLang, $wgDefaultBlockExpiry; |
| | 50 | + global $wgOut, $wgUser, $wgLang, $wgBlockExpiryOptions; |
| 51 | 51 | global $wgRequest; |
| 52 | 52 | |
| 53 | 53 | $wgOut->setPagetitle( htmlspecialchars( wfMsg( 'blockip' ) ) ); |
| 54 | 54 | $wgOut->addWikiText( htmlspecialchars( wfMsg( 'blockiptext' ) ) ); |
| 55 | 55 | |
| 56 | | - if ( is_null( $this->BlockExpiry ) || $this->BlockExpiry === '' ) { |
| 57 | | - $this->BlockExpiry = $wgDefaultBlockExpiry; |
| 58 | | - } |
| 59 | | - |
| 60 | 56 | $mIpaddress = htmlspecialchars( wfMsg( 'ipaddress' ) ); |
| 61 | 57 | $mIpbexpiry = htmlspecialchars( wfMsg( 'ipbexpiry' ) ); |
| 62 | 58 | $mIpbreason = htmlspecialchars( wfMsg( 'ipbreason' ) ); |
| — | — | @@ -71,6 +67,10 @@ |
| 72 | 68 | $scBlockAddress = htmlspecialchars( $this->BlockAddress ); |
| 73 | 69 | $scBlockExpiry = htmlspecialchars( $this->BlockExpiry ); |
| 74 | 70 | $scBlockReason = htmlspecialchars( $this->BlockReason ); |
| | 71 | + |
| | 72 | + $blockExpiryOptions = join("</option><option>", split(",", $wgBlockExpiryOptions)); |
| | 73 | + $blockExpiryOptions = "<option>" . $blockExpiryOptions . "</option>"; |
| | 74 | + |
| 75 | 75 | $token = htmlspecialchars( $wgUser->editToken() ); |
| 76 | 76 | |
| 77 | 77 | $wgOut->addHTML( " |
| — | — | @@ -85,17 +85,8 @@ |
| 86 | 86 | <tr> |
| 87 | 87 | <td align=\"right\">{$mIpbexpiry}:</td> |
| 88 | 88 | <td align=\"left\"> |
| 89 | | - <select name=\"wpBlockExpiry\"/> |
| 90 | | - <option>2 hours</option> |
| 91 | | - <option>1 day</option> |
| 92 | | - <option>3 days</option> |
| 93 | | - <option>1 week</option> |
| 94 | | - <option>2 weeks</option> |
| 95 | | - <option>1 month</option> |
| 96 | | - <option>3 months</option> |
| 97 | | - <option>6 months</option> |
| 98 | | - <option>1 year</option> |
| 99 | | - <option>indefinite</option> |
| | 89 | + <select tabindex='2' name=\"wpBlockExpiry\"/> |
| | 90 | + <?= $blockExpiryOptions ?> |
| 100 | 91 | </select> |
| 101 | 92 | </td> |
| 102 | 93 | </tr> |
| — | — | @@ -169,6 +160,7 @@ |
| 170 | 161 | |
| 171 | 162 | } |
| 172 | 163 | |
| | 164 | + |
| 173 | 165 | if ( $this->BlockReason == '') { |
| 174 | 166 | $this->showForm( wfMsg( 'noblockreason' ) ); |
| 175 | 167 | return; |
| — | — | @@ -181,7 +173,6 @@ |
| 182 | 174 | $this->BlockReason, wfTimestampNow(), 0, $expiry ); |
| 183 | 175 | |
| 184 | 176 | if (wfRunHooks('BlockIp', $ban, $wgUser)) { |
| 185 | | - |
| 186 | 177 | $ban->insert(); |
| 187 | 178 | |
| 188 | 179 | wfRunHooks('BlockIpComplete', $ban, $wgUser); |
| Index: trunk/phase3/includes/DefaultSettings.php |
| — | — | @@ -457,8 +457,12 @@ |
| 458 | 458 | |
| 459 | 459 | $wgSysopUserBans = false; # Allow sysops to ban logged-in users |
| 460 | 460 | $wgSysopRangeBans = false; # Allow sysops to ban IP ranges |
| 461 | | -$wgDefaultBlockExpiry = '24 hours'; # default expiry time |
| 462 | | - # strtotime format, or "infinite" for an infinite block |
| | 461 | + |
| | 462 | +/** Comma-separated list of options to show on the IP block form. |
| | 463 | + * Use strtotime() format, or "infinite" for an infinite block |
| | 464 | + */ |
| | 465 | +$wgBlockExpiryOptions = "2 hours,1 day,3 days,1 week,2 weeks,1 month,3 months,6 months,1 year,infinite"; |
| | 466 | + |
| 463 | 467 | $wgAutoblockExpiry = 86400; # Number of seconds before autoblock entries expire |
| 464 | 468 | |
| 465 | 469 | # Proxy scanner settings |
| — | — | @@ -1124,4 +1128,4 @@ |
| 1125 | 1129 | } else { |
| 1126 | 1130 | die(); |
| 1127 | 1131 | } |
| 1128 | | -?> |
| \ No newline at end of file |
| | 1132 | +?> |