Index: trunk/extensions/CheckUser/CheckUser_body.php |
— | — | @@ -50,14 +50,10 @@ |
51 | 51 | |
52 | 52 | if ( !$wgUser->isAllowed( 'checkuser' ) ) { |
53 | 53 | if ( $wgUser->isAllowed( 'checkuser-log' ) ) { |
54 | | - $wgOut->addWikiText( wfMsg( 'checkuser-summary' ) . |
55 | | - "\n\n[[" . $this->getLogSubpageTitle()->getPrefixedText() . |
56 | | - '|' . wfMsg( 'checkuser-showlog' ) . ']]' |
57 | | - ); |
58 | | - return; |
| 54 | + $this->showGuide(); |
| 55 | + } else { |
| 56 | + $wgOut->permissionRequired( 'checkuser' ); |
59 | 57 | } |
60 | | - |
61 | | - $wgOut->permissionRequired( 'checkuser' ); |
62 | 58 | return; |
63 | 59 | } |
64 | 60 | |
— | — | @@ -92,7 +88,7 @@ |
93 | 89 | $xff = ''; |
94 | 90 | } |
95 | 91 | |
96 | | - $this->doForm( $user, $reason, $checktype, $ip, $xff, $name, $period ); |
| 92 | + $this->showForm( $user, $reason, $checktype, $ip, $xff, $name, $period ); |
97 | 93 | |
98 | 94 | # Perform one of the various submit operations... |
99 | 95 | if ( $wgRequest->wasPosted() ) { |
— | — | @@ -139,7 +135,15 @@ |
140 | 136 | return $this->logSubpageTitle; |
141 | 137 | } |
142 | 138 | |
143 | | - protected function doForm( $user, $reason, $checktype, $ip, $xff, $name, $period ) { |
| 139 | + protected function showGuide() { |
| 140 | + global $wgOut; |
| 141 | + $wgOut->addWikiText( wfMsg( 'checkuser-summary' ) . |
| 142 | + "\n\n[[" . $this->getLogSubpageTitle()->getPrefixedText() . |
| 143 | + '|' . wfMsg( 'checkuser-showlog' ) . ']]' |
| 144 | + ); |
| 145 | + } |
| 146 | + |
| 147 | + protected function showForm( $user, $reason, $checktype, $ip, $xff, $name, $period ) { |
144 | 148 | global $wgOut, $wgUser; |
145 | 149 | $action = $this->getTitle()->escapeLocalUrl(); |
146 | 150 | # Fill in requested type if it makes sense |
— | — | @@ -156,14 +160,9 @@ |
157 | 161 | } else { |
158 | 162 | $encuserips = 1; |
159 | 163 | } |
160 | | - # Compile our nice form |
161 | | - # User box length should fit things like "2001:0db8:85a3:08d3:1319:8a2e:0370:7344/100/xff" |
162 | | - if ( $wgUser->isAllowed( 'checkuser-log' ) ) { |
163 | | - $wgOut->addWikiText( wfMsg( 'checkuser-summary' ) . |
164 | | - "\n\n[[" . $this->getLogSubpageTitle()->getPrefixedText() . |
165 | | - '|' . wfMsg( 'checkuser-showlog' ) . ']]' |
166 | | - ); |
167 | | - } |
| 164 | + # Compile our nice form... |
| 165 | + # Username field should fit things like "2001:0db8:85a3:08d3:1319:8a2e:0370:7344/100/xff" |
| 166 | + $this->showGuide(); // explanation text |
168 | 167 | |
169 | 168 | $form = Xml::openElement( 'form', array( 'action' => $action, |
170 | 169 | 'name' => 'checkuserform', 'id' => 'checkuserform', 'method' => 'post' ) ); |