Major changes to user groups:
[lhc/web/wiklou.git] / includes / SpecialBlockip.php
index fe34d41..d5e58c6 100644 (file)
@@ -47,12 +47,16 @@ class IPBlockForm {
        
        function showForm( $err ) {
                global $wgOut, $wgUser, $wgLang, $wgBlockExpiryOptions;
-               global $wgRequest;
+               global $wgRequest, $wgSysopUserBans;
 
                $wgOut->setPagetitle( htmlspecialchars( wfMsg( 'blockip' ) ) );
-               $wgOut->addWikiText( htmlspecialchars( wfMsg( 'blockiptext' ) ) );
+               $wgOut->addWikiText( wfMsg( 'blockiptext' ) );
 
-               $mIpaddress = htmlspecialchars( wfMsg( 'ipaddress' ) );
+               if($wgSysopUserBans) {
+                       $mIpaddress = htmlspecialchars( wfMsg( 'ipadressorusername' ) );
+               } else {
+                       $mIpaddress = htmlspecialchars( wfMsg( 'ipaddress' ) );
+               }
                $mIpbexpiry = htmlspecialchars( wfMsg( 'ipbexpiry' ) );
                $mIpbreason = htmlspecialchars( wfMsg( 'ipbreason' ) );
                $mIpbsubmit = htmlspecialchars( wfMsg( 'ipbsubmit' ) );
@@ -68,8 +72,9 @@ class IPBlockForm {
                $scBlockExpiry = htmlspecialchars( $this->BlockExpiry );
                $scBlockReason = htmlspecialchars( $this->BlockReason );
 
-               $blockExpiryFormOptions = join("</option><option>", split(",", $wgBlockExpiryOptions));
-               $blockExpiryFormOptions = "<option>" . $blockExpiryFormOptions . "</option>";
+               $blockExpiryFormOptions = '<option>' .
+                       implode("</option>\n\t\t\t\t\t<option>", explode(',', $wgBlockExpiryOptions)) .
+                       '</option>';
 
                $token = htmlspecialchars( $wgUser->editToken() );
                
@@ -85,7 +90,7 @@ class IPBlockForm {
                <tr>
                        <td align=\"right\">{$mIpbexpiry}:</td>
                        <td align=\"left\">
-                               <select tabindex='2' name=\"wpBlockExpiry\"/>
+                               <select tabindex='2' name=\"wpBlockExpiry\">
                                        $blockExpiryFormOptions
                                </select>
                        </td>
@@ -160,12 +165,6 @@ class IPBlockForm {
 
                }
                
-
-               if ( $this->BlockReason == '') {
-                       $this->showForm( wfMsg( 'noblockreason' ) );
-                       return;
-               }
-               
                # Create block
                # Note: for a user block, ipb_address is only for display purposes