$wgSysopUserBans = false; # Allow sysops to ban logged-in users
$wgSysopRangeBans = false; # Allow sysops to ban IP ranges
-$wgDefaultBlockExpiry = '24 hours'; # default expiry time
- # strtotime format, or "infinite" for an infinite block
+
+/** Comma-separated list of options to show on the IP block form.
+ * Use strtotime() format, or "infinite" for an infinite block
+ */
+$wgBlockExpiryOptions = "2 hours,1 day,3 days,1 week,2 weeks,1 month,3 months,6 months,1 year,infinite";
+
$wgAutoblockExpiry = 86400; # Number of seconds before autoblock entries expire
# Proxy scanner settings
} else {
die();
}
-?>
\ No newline at end of file
+?>
}
function showForm( $err ) {
- global $wgOut, $wgUser, $wgLang, $wgDefaultBlockExpiry;
+ global $wgOut, $wgUser, $wgLang, $wgBlockExpiryOptions;
global $wgRequest;
$wgOut->setPagetitle( htmlspecialchars( wfMsg( 'blockip' ) ) );
$wgOut->addWikiText( htmlspecialchars( wfMsg( 'blockiptext' ) ) );
- if ( is_null( $this->BlockExpiry ) || $this->BlockExpiry === '' ) {
- $this->BlockExpiry = $wgDefaultBlockExpiry;
- }
-
$mIpaddress = htmlspecialchars( wfMsg( 'ipaddress' ) );
$mIpbexpiry = htmlspecialchars( wfMsg( 'ipbexpiry' ) );
$mIpbreason = htmlspecialchars( wfMsg( 'ipbreason' ) );
$scBlockAddress = htmlspecialchars( $this->BlockAddress );
$scBlockExpiry = htmlspecialchars( $this->BlockExpiry );
$scBlockReason = htmlspecialchars( $this->BlockReason );
+
+ $blockExpiryOptions = join("</option><option>", split(",", $wgBlockExpiryOptions));
+ $blockExpiryOptions = "<option>" . $blockExpiryOptions . "</option>";
+
$token = htmlspecialchars( $wgUser->editToken() );
$wgOut->addHTML( "
<tr>
<td align=\"right\">{$mIpbexpiry}:</td>
<td align=\"left\">
- <select name=\"wpBlockExpiry\"/>
- <option>2 hours</option>
- <option>1 day</option>
- <option>3 days</option>
- <option>1 week</option>
- <option>2 weeks</option>
- <option>1 month</option>
- <option>3 months</option>
- <option>6 months</option>
- <option>1 year</option>
- <option>indefinite</option>
+ <select tabindex='2' name=\"wpBlockExpiry\"/>
+ <?= $blockExpiryOptions ?>
</select>
</td>
</tr>
}
+
if ( $this->BlockReason == '') {
$this->showForm( wfMsg( 'noblockreason' ) );
return;
$this->BlockReason, wfTimestampNow(), 0, $expiry );
if (wfRunHooks('BlockIp', $ban, $wgUser)) {
-
$ban->insert();
wfRunHooks('BlockIpComplete', $ban, $wgUser);