From: Rob Church Date: Wed, 30 Aug 2006 14:36:19 +0000 (+0000) Subject: * (bug 4434) Show block log fragment on Special:Blockip X-Git-Tag: 1.31.0-rc.0~55875 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=1d53e96a3589e342f0aa9af85a35cb0b0d53d0d9;p=lhc%2Fweb%2Fwiklou.git * (bug 4434) Show block log fragment on Special:Blockip --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c74da84c37..d3dbcbdfee 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -166,6 +166,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Include SVN revision number in {{CURRENTVERSION}} output, where applicable * Fix bug in wfRunHooks which caused corruption of objects in the hook list * (bug 4979) Use simplified email addresses when running on Windows +* (bug 4434) Show block log fragment on Special:Blockip == Languages updated == diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index 335ad97fa5..4eb4957a55 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -165,6 +165,13 @@ class IPBlockForm { \n" ); + $user = User::newFromName( $this->BlockAddress ); + if( is_object( $user ) ) { + $this->showLogFragment( $wgOut, $user->getUserPage() ); + } elseif( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/', $this->BlockAddress ) ) { + $this->showLogFragment( $wgOut, Title::makeTitle( NS_USER, $this->BlockAddress ) ); + } + } function doSubmit() { @@ -267,6 +274,14 @@ class IPBlockForm { $text = wfMsg( 'blockipsuccesstext', $this->BlockAddress ); $wgOut->addWikiText( $text ); } + + function showLogFragment( &$out, &$title ) { + $out->addHtml( wfElement( 'h2', NULL, LogPage::logName( 'block' ) ) ); + $request = new FauxRequest( array( 'page' => $title->getPrefixedText(), 'type' => 'block' ) ); + $viewer = new LogViewer( new LogReader( $request ) ); + $viewer->showList( $out ); + } + } ?>