r67332 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67331‎ | r67332 | r67333 >
Date:09:52, 4 June 2010
Author:catrope
Status:ok
Tags:
Comment:
ContactPage: Tweak $wgContactIncludeIP behavior per bug 22741 comment #11: checkbox is now hidden for anonymous users, their IP is always sent. For logged-in users, the checkbox is still there and retains its previous behavior
Modified paths:
  • /trunk/extensions/ContactPage/SpecialContact.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContactPage/SpecialContact.php
@@ -230,11 +230,11 @@
231231 Xml::textarea( 'wpText', $this->text, 80, 20, array( 'id' => 'wpText' ) ) .
232232 '</td>
233233 </tr>';
234 - if ( $wgContactIncludeIP ) {
 234+ if ( $wgContactIncludeIP && $wgUser->isLoggedIn() ) {
235235 $form .= '<tr>
236236 <td></td>
237237 <td class="mw-input">' .
238 - Xml::checkLabel( wfMsg( 'contactpage-includeip' ), 'wpIncludeIP', 'wpIncludeIP', $wgUser->isAnon() ) .
 238+ Xml::checkLabel( wfMsg( 'contactpage-includeip' ), 'wpIncludeIP', 'wpIncludeIP', false ) .
239239 '</td>
240240 </tr>';
241241 }
@@ -300,7 +300,7 @@
301301 }
302302
303303 function doSubmit() {
304 - global $wgOut;
 304+ global $wgOut, $wgUser;
305305 global $wgEnableEmail, $wgUserEmailUseReplyTo, $wgEmergencyContact;
306306 global $wgContactUser, $wgContactSender, $wgContactSenderName, $wgContactIncludeIP;
307307
@@ -329,7 +329,7 @@
330330 $subject = wfMsgForContent( 'contactpage-defsubject' );
331331 }
332332
333 - $includeIP = $wgContactIncludeIP && $this->includeIP;
 333+ $includeIP = $wgContactIncludeIP && ( $this->includeIP || $wgUser->isAnon() );
334334 if ( $this->fromname !== '' ) {
335335 if ( $includeIP ) {
336336 $subject = wfMsgForContent( 'contactpage-subject-and-sender-withip', $subject, $this->fromname, $senderIP );

Follow-up revisions

RevisionCommit summaryAuthorDate
r673331.16wmf4: MFT r67332catrope09:54, 4 June 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63310ContactPage: (bug 22741) Add IP address of sender to subject linecatrope14:00, 6 March 2010

Status & tagging log