*/
function wfSpecialIpblocklist() {
global $wgUser, $wgOut, $wgRequest;
-
+
$ip = $wgRequest->getVal( 'wpUnblockAddress', $wgRequest->getVal( 'ip' ) );
$reason = $wgRequest->getText( 'wpUnblockReason' );
$action = $wgRequest->getText( 'action' );
-
+
$ipu = new IPUnblockForm( $ip, $reason );
if ( "success" == $action ) {
*/
class IPUnblockForm {
var $ip, $reason;
-
+
function IPUnblockForm( $ip, $reason ) {
$this->ip = $ip;
$this->reason = $reason;
}
-
+
function showForm( $err ) {
global $wgOut, $wgUser, $wgSysopUserBans;
$wgOut->addWikitext( "<span class='error'>{$err}</span>\n" );
}
$token = htmlspecialchars( $wgUser->editToken() );
-
+
$wgOut->addHTML( "
<form id=\"unblockip\" method=\"post\" action=\"{$action}\">
<table border='0'>
</form>\n" );
}
-
+
function doSubmit() {
global $wgOut, $wgUser;
function showList( $msg ) {
global $wgOut;
-
+
$wgOut->setPagetitle( wfMsg( "ipblocklist" ) );
if ( "" != $msg ) {
$wgOut->setSubtitle( $msg );
global $wgRequest;
list( $this->limit, $this->offset ) = $wgRequest->getLimitOffset();
$this->counter = 0;
-
+
$paging = '<p>' . wfViewPrevNext( $this->offset, $this->limit,
Title::makeTitle( NS_SPECIAL, 'Ipblocklist' ),
'ip=' . urlencode( $this->ip ) ) . "</p>\n";
$wgOut->addHTML( $paging );
-
+
$search = $this->searchForm();
$wgOut->addHTML( $search );
$wgOut->addHTML( "</ul>\n" );
$wgOut->addHTML( $paging );
}
-
+
function searchForm() {
global $wgTitle;
return
*/
function addRow( $block, $tag ) {
global $wgOut, $wgUser, $wgLang;
-
+
if( $this->ip != '' ) {
if( $block->mAuto ) {
if( stristr( $block->mId, $this->ip ) == false ) {
}
}
}
-
+
// Loading blocks is fast; displaying them is slow.
// Quick hack for paging.
$this->counter++;
if( $this->counter - $this->offset > $this->limit ) {
return;
}
-
+
$fname = 'IPUnblockForm-addRow';
wfProfileIn( $fname );
-
+
static $sk=null, $msg=null;
-
+
if( is_null( $sk ) )
$sk = $wgUser->getSkin();
if( is_null( $msg ) ) {
}
$msg['blocklistline'] = wfMsg( 'blocklistline' );
}
-
+
# Hide addresses blocked by User::spreadBlocks, for privacy
$addr = $block->mAuto ? "#{$block->mId}" : $block->mAddress;
-
+
$name = $block->getByName();
$ulink = $sk->makeKnownLinkObj( Title::makeTitle( NS_USER, $name ), $name );
$formattedTime = $wgLang->timeanddate( $block->mTimestamp, true );
-
+
if ( $block->mExpiry === "" ) {
$formattedExpiry = $msg['infiniteblock'];
} else {
$formattedExpiry = wfMsgReplaceArgs( $msg['expiringblock'],
array( $wgLang->timeanddate( $block->mExpiry, true ) ) );
}
-
+
$line = wfMsgReplaceArgs( $msg['blocklistline'], array( $formattedTime, $ulink, $addr, $formattedExpiry ) );
-
+
$wgOut->addHTML( "<li>{$line}" );
-
+
if ( !$block->mAuto ) {
$titleObj = Title::makeTitle( NS_SPECIAL, "Contributions" );
$wgOut->addHTML( ' (' . $sk->makeKnownLinkObj($titleObj, $msg['contribslink'], "target={$block->mAddress}") . ')' );
}
-
+
if ( $wgUser->isAllowed('block') ) {
$titleObj = Title::makeTitle( NS_SPECIAL, "Ipblocklist" );
$wgOut->addHTML( ' (' . $sk->makeKnownLinkObj($titleObj, $msg['unblocklink'], 'action=unblock&ip=' . urlencode( $addr ) ) . ')' );