renamed NAMESPACE constant to NAMESPACE_RESTRICTION (and PAGE to PAGE_RESTRICTION...
[lhc/web/wiklou.git] / includes / specials / SpecialBlockip.php
index 25e0795..e7f43ee 100644 (file)
@@ -467,7 +467,7 @@ class IPBlockForm {
 
                        # Set *_deleted fields if requested
                        if( $this->BlockHideName ) {
-                               self::suppressUserName( $this->BlockAddress, $userId, $reasonstr );
+                               self::suppressUserName( $this->BlockAddress, $userId );
                        }
 
                        # Only show watch link when this is no range block
@@ -497,20 +497,7 @@ class IPBlockForm {
                }
        }
        
-       public static function suppressUserName( $name, $userId, $reason = '' ) {
-               $user = User::newFromName( $name, false );
-               # Delete the user pages that exists
-               $title = $user->getUserPage();
-               if( ($id = $title->getArticleID(GAID_FOR_UPDATE)) ) {
-                       $article = new Article( $title );
-                       $article->doDeleteArticle( $reason, true /*suppress*/, $id );
-               }
-               # Delete the user talk pages that exists
-               $title = $user->getTalkPage();
-               if( $id = $title->getArticleID(GAID_FOR_UPDATE) ) {
-                       $article = new Article( $title );
-                       $article->doDeleteArticle( $reason, true /*suppress*/, $id );
-               }
+       public static function suppressUserName( $name, $userId ) {
                $op = '|'; // bitwise OR
                return self::setUsernameBitfields( $name, $userId, $op );
        }
@@ -649,7 +636,13 @@ class IPBlockForm {
                        $links[] = $this->getContribsLink( $skin );
                $links[] = $this->getUnblockLink( $skin );
                $links[] = $this->getBlockListLink( $skin );
-               $links[] = $skin->makeLink ( 'MediaWiki:Ipbreason-dropdown', wfMsgHtml( 'ipb-edit-dropdown' ) );
+               $title = Title::makeTitle( NS_MEDIAWIKI, 'Ipbreason-dropdown' );
+               $links[] = $skin->link(
+                       $title,
+                       wfMsgHtml( 'ipb-edit-dropdown' ),
+                       array(),
+                       array( 'action' => 'edit' )
+               );
                return '<p class="mw-ipb-conveniencelinks">' . $wgLang->pipeList( $links ) . '</p>';
        }
        
@@ -675,13 +668,21 @@ class IPBlockForm {
         */
        private function getUnblockLink( $skin ) {
                $list = SpecialPage::getTitleFor( 'Ipblocklist' );
+               $query = array( 'action' => 'unblock' );
+
                if( $this->BlockAddress ) {
                        $addr = htmlspecialchars( strtr( $this->BlockAddress, '_', ' ' ) );
-                       return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock-addr', $addr ),
-                               'action=unblock&ip=' . urlencode( $this->BlockAddress ) );
+                       $message = wfMsgHtml( 'ipb-unblock-addr', $addr );
+                       $query['ip'] = $this->BlockAddress;
                } else {
-                       return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock' ),      'action=unblock' );
+                       $message = wfMsgHtml( 'ipb-unblock' );
                }
+               return $skin->linkKnown(
+                       $list,
+                       $message,
+                       array(),
+                       $query
+               );
        }
 
        /**
@@ -692,13 +693,22 @@ class IPBlockForm {
         */
        private function getBlockListLink( $skin ) {
                $list = SpecialPage::getTitleFor( 'Ipblocklist' );
+               $query = array();
+
                if( $this->BlockAddress ) {
                        $addr = htmlspecialchars( strtr( $this->BlockAddress, '_', ' ' ) );
-                       return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-blocklist-addr', $addr ),
-                               'ip=' . urlencode( $this->BlockAddress ) );
+                       $message = wfMsgHtml( 'ipb-blocklist-addr', $addr );
+                       $query['ip'] = $this->BlockAddress;
                } else {
-                       return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-blocklist' ) );
+                       $message = wfMsgHtml( 'ipb-blocklist' );
                }
+
+               return $skin->linkKnown(
+                       $list,
+                       $message,
+                       array(),
+                       $query
+               );
        }
        
        /**