From 8f416baead93a48e5799e44b8bd2e2c4859f4e04 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 14 Sep 2007 13:18:58 +0200 Subject: auf Version 1.11 aktualisiert; Login-Bug behoben --- includes/SpecialBlockip.php | 69 +++++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 24 deletions(-) (limited to 'includes/SpecialBlockip.php') diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index 5f47fa13..942ebe8b 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -43,6 +43,7 @@ function wfSpecialBlockip( $par ) { */ class IPBlockForm { var $BlockAddress, $BlockExpiry, $BlockReason; +# var $BlockEmail; function IPBlockForm( $par ) { global $wgRequest, $wgUser; @@ -60,12 +61,13 @@ class IPBlockForm { $this->BlockAnonOnly = $wgRequest->getBool( 'wpAnonOnly', $byDefault ); $this->BlockCreateAccount = $wgRequest->getBool( 'wpCreateAccount', $byDefault ); $this->BlockEnableAutoblock = $wgRequest->getBool( 'wpEnableAutoblock', $byDefault ); + $this->BlockEmail = $wgRequest->getBool( 'wpEmailBan', false ); # Re-check user's rights to hide names, very serious, defaults to 0 - $this->BlockHideName = $wgRequest->getBool( 'wpHideName', 0 ) && $wgUser->isAllowed( 'hideuser' ); + $this->BlockHideName = ( $wgRequest->getBool( 'wpHideName', 0 ) && $wgUser->isAllowed( 'hideuser' ) ) ? 1 : 0; } function showForm( $err ) { - global $wgOut, $wgUser, $wgSysopUserBans; + global $wgOut, $wgUser, $wgSysopUserBans, $wgContLang; $wgOut->setPagetitle( wfMsg( 'blockip' ) ); $wgOut->addWikiText( wfMsg( 'blockiptext' ) ); @@ -84,6 +86,7 @@ class IPBlockForm { $titleObj = SpecialPage::getTitleFor( 'Blockip' ); $action = $titleObj->escapeLocalURL( "action=submit" ); + $alignRight = $wgContLang->isRtl() ? 'left' : 'right'; if ( "" != $err ) { $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) ); @@ -141,7 +144,7 @@ class IPBlockForm { $blockReasonList .= $optgroup; } - $token = htmlspecialchars( $wgUser->editToken() ); + $token = $wgUser->editToken(); global $wgStylePath, $wgStyleVersion; $wgOut->addHTML( " @@ -150,8 +153,8 @@ class IPBlockForm {
- - + "); if ($showblockoptions) { $wgOut->addHTML(" - - + - - + @@ -182,8 +185,8 @@ class IPBlockForm { if ( $blockReasonList != '' ) { $wgOut->addHTML(" - - + - - + - - - - "); } + + global $wgSysopEmailBans; + + if ( $wgSysopEmailBans && $wgUser->isAllowed( 'blockemail' ) ) { + $wgOut->addHTML(" + + + + + "); + } $wgOut->addHTML(" -
{$mIpaddress}: + {$mIpaddress} " . Xml::input( 'wpBlockAddress', 45, $this->BlockAddress, array( 'tabindex' => '1', @@ -162,8 +165,8 @@ class IPBlockForm {
{$mIpbexpiry}: + {$mIpbexpiry} @@ -173,8 +176,8 @@ class IPBlockForm { $wgOut->addHTML("
{$mIpbother}: + {$mIpbother} " . Xml::input( 'wpBlockOther', 45, $this->BlockOther, array( 'tabindex' => '3', 'id' => 'mw-bi-other' ) ) . "
{$mIpbreasonother}: + {$mIpbreasonother} @@ -192,15 +195,16 @@ class IPBlockForm { } $wgOut->addHTML("
{$mIpbreason}: + {$mIpbreason} " . Xml::input( 'wpBlockReason', 45, $this->BlockReason, - array( 'tabindex' => '5', 'id' => 'mw-bi-reason' ) ) . " + array( 'tabindex' => '5', 'id' => 'mw-bi-reason', + 'maxlength'=> '200' ) ) . "
  + " . wfCheckLabel( wfMsgHtml( 'ipbanononly' ), 'wpAnonOnly', 'wpAnonOnly', $this->BlockAnonOnly, array( 'tabindex' => '6' ) ) . " @@ -208,7 +212,7 @@ class IPBlockForm {
  + " . wfCheckLabel( wfMsgHtml( 'ipbcreateaccount' ), 'wpCreateAccount', 'wpCreateAccount', $this->BlockCreateAccount, array( 'tabindex' => '7' ) ) . " @@ -216,7 +220,7 @@ class IPBlockForm {
  + " . wfCheckLabel( wfMsgHtml( 'ipbenableautoblock' ), 'wpEnableAutoblock', 'wpEnableAutoblock', $this->BlockEnableAutoblock, array( 'tabindex' => '8' ) ) . " @@ -228,7 +232,7 @@ class IPBlockForm { $wgOut->addHTML("
  + " . wfCheckLabel( wfMsgHtml( 'ipbhidename' ), 'wpHideName', 'wpHideName', $this->BlockHideName, array( 'tabindex' => '9' ) ) . " @@ -236,12 +240,27 @@ class IPBlockForm {
  + " . wfCheckLabel( wfMsgHtml( 'ipbemailban' ), + 'wpEmailBan', 'wpEmailBan', $this->BlockEmail, + array( 'tabindex' => '10' )) . " +
  - " . Xml::submitButton( wfMsgHtml( 'ipbsubmit' ), - array( 'name' => 'wpBlock', 'tabindex' => '10' ) ) . " + + " . Xml::submitButton( wfMsg( 'ipbsubmit' ), + array( 'name' => 'wpBlock', 'tabindex' => '11' ) ) . "
" . @@ -354,10 +373,10 @@ class IPBlockForm { # Create block # Note: for a user block, ipb_address is only for display purposes - $block = new Block( $this->BlockAddress, $userId, $wgUser->getID(), $reasonstr, wfTimestampNow(), 0, $expiry, $this->BlockAnonOnly, - $this->BlockCreateAccount, $this->BlockEnableAutoblock, $this->BlockHideName); + $this->BlockCreateAccount, $this->BlockEnableAutoblock, $this->BlockHideName, + $this->BlockEmail); if (wfRunHooks('BlockIp', array(&$block, &$wgUser))) { @@ -418,6 +437,8 @@ class IPBlockForm { $flags[] = 'nocreate'; if( !$this->BlockEnableAutoblock ) $flags[] = 'noautoblock'; + if ( $this->BlockEmail ) + $flags[] = 'noemail'; return implode( ',', $flags ); } @@ -471,4 +492,4 @@ class IPBlockForm { } } } -?> + -- cgit v1.2.2