$out is needed here
[lhc/web/wiklou.git] / includes / SpecialIpblocklist.php
index c2de9e2..7121fb9 100644 (file)
@@ -76,6 +76,11 @@ class IPUnblockForm {
                $this->reason = $reason;
        }
 
+       /**
+        * Generates the unblock form
+        * @param $err string: error message
+        * @return $out string: HTML form
+        */
        function showForm( $err ) {
                global $wgOut, $wgUser, $wgSysopUserBans, $wgContLang;
 
@@ -83,8 +88,6 @@ class IPUnblockForm {
                $wgOut->addWikiMsg( 'unblockiptext' );
 
                $ipa = wfMsgHtml( $wgSysopUserBans ? 'ipadressorusername' : 'ipaddress' );
-               $ipr = wfMsgHtml( 'ipbreason' );
-               $ipus = wfMsgHtml( 'ipusubmit' );
                $titleObj = SpecialPage::getTitleFor( "Ipblocklist" );
                $action = $titleObj->getLocalURL( "action=submit" );
                $alignRight = $wgContLang->isRtl() ? 'left' : 'right';
@@ -110,7 +113,9 @@ class IPUnblockForm {
 
                $wgOut->addHTML(
                        Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'unblockip' ) ) .
-                       Xml::openElement( 'table', array( 'border' => '0' ) ).
+                       Xml::openElement( 'fieldset' ) .
+                       Xml::element( 'legend', null, wfMsg( 'ipb-unblock' ) ) .
+                       Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-unblock-table' ) ).
                        "<tr>
                                <td align='$alignRight'>
                                        {$ipa}
@@ -120,9 +125,9 @@ class IPUnblockForm {
                                </td>
                        </tr>
                        <tr>
-                               <td align='$alignRight'>
-                                       {$ipr}
-                               </td>
+                               <td align='$alignRight'>" .
+                                       Xml::label( wfMsg( 'ipbreason' ), 'wpUnblockReason' ) . 
+                               "</td>
                                <td>" .
                                        Xml::input( 'wpUnblockReason', 40, $this->reason, array( 'type' => 'text', 'tabindex' => '2' ) ) .
                                "</td>
@@ -130,10 +135,11 @@ class IPUnblockForm {
                        <tr>
                                <td>&nbsp;</td>
                                <td>" .
-                                       Xml::submitButton( $ipus, array( 'name' => 'wpBlock', 'tabindex' => '3' ) ) .
+                                       Xml::submitButton( wfMsg( 'ipusubmit' ), array( 'name' => 'wpBlock', 'tabindex' => '3' ) ) .
                                "</td>
                        </tr>" .
                        Xml::closeElement( 'table' ) .
+                       Xml::closeElement( 'fieldset' ) .
                        Xml::hidden( 'wpEditToken', $token ) .
                        Xml::closeElement( 'form' ) . "\n"
                );
@@ -230,7 +236,7 @@ class IPUnblockForm {
                $conds = array();
                $matches = array();
                // Is user allowed to see all the blocks?
-               if ( !$wgUser->isAllowed( 'oversight' ) )
+               if ( !$wgUser->isAllowed( 'suppress' ) )
                        $conds['ipb_deleted'] = 0;
                if ( $this->ip == '' ) {
                        // No extra conditions
@@ -393,7 +399,7 @@ class IPBlocklistPager extends ReverseChronologicalPager {
                # Usernames and titles are in fact related by a simple substitution of space -> underscore
                # The last few lines of Title::secureAndSplit() tell the story.
                while ( $row = $this->mResult->fetchObject() ) {
-                       $name = str_replace( ' ', '_', $row->user_name );
+                       $name = str_replace( ' ', '_', $row->ipb_by_text );
                        $lb->add( NS_USER, $name );
                        $lb->add( NS_USER_TALK, $name );
                        $name = str_replace( ' ', '_', $row->ipb_address );
@@ -414,10 +420,9 @@ class IPBlocklistPager extends ReverseChronologicalPager {
        function getQueryInfo() {
                $conds = $this->mConds;
                $conds[] = 'ipb_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() );
-               $conds[] = 'ipb_by=user_id';
                return array(
-                       'tables' => array( 'ipblocks', 'user' ),
-                       'fields' => $this->mDb->tableName( 'ipblocks' ) . '.*,user_name',
+                       'tables' => 'ipblocks',
+                       'fields' => '*',
                        'conds' => $conds,
                );
        }