Index: trunk/extensions/ContactPage/SpecialContact.php |
— | — | @@ -108,6 +108,7 @@ |
109 | 109 | $this->text = $wgRequest->getText( 'wpText' ); |
110 | 110 | $this->subject = $wgRequest->getText( 'wpSubject' ); |
111 | 111 | $this->cc_me = $wgRequest->getBool( 'wpCCMe' ); |
| 112 | + $this->includeIP = $wgRequest->getBool( 'wpIncludeIP' ); |
112 | 113 | |
113 | 114 | $this->fromname = $wgRequest->getText( 'wpFromName' ); |
114 | 115 | $this->fromaddress = $wgRequest->getText( 'wpFromAddress' ); |
— | — | @@ -165,7 +166,7 @@ |
166 | 167 | } |
167 | 168 | |
168 | 169 | function showForm() { |
169 | | - global $wgOut, $wgUser, $wgContactRequireAll; |
| 170 | + global $wgOut, $wgUser, $wgContactRequireAll, $wgContactIncludeIP; |
170 | 171 | |
171 | 172 | #TODO: show captcha |
172 | 173 | |
— | — | @@ -228,8 +229,17 @@ |
229 | 230 | <td class="mw-input">' . |
230 | 231 | Xml::textarea( 'wpText', $this->text, 80, 20, array( 'id' => 'wpText' ) ) . |
231 | 232 | '</td> |
232 | | - </tr> |
233 | | - <tr> |
| 233 | + </tr>'; |
| 234 | + if ( $wgContactIncludeIP ) { |
| 235 | + $form .= '<tr> |
| 236 | + <td></td> |
| 237 | + <td class="mw-input">' . |
| 238 | + Xml::checkLabel( wfMsg( 'contactpage-includeip' ), 'wpIncludeIP', 'wpIncludeIP', $wgUser->isAnon() ) . |
| 239 | + '</td> |
| 240 | + </tr>'; |
| 241 | + } |
| 242 | + |
| 243 | + $form .= '<tr> |
234 | 244 | <td></td> |
235 | 245 | <td class="mw-input">' . |
236 | 246 | Xml::checkLabel( wfMsg( 'emailccme' ), 'wpCCMe', 'wpCCMe', $wgUser->getBoolOption( 'ccmeonemails' ) ) . |
— | — | @@ -292,7 +302,7 @@ |
293 | 303 | function doSubmit() { |
294 | 304 | global $wgOut; |
295 | 305 | global $wgEnableEmail, $wgUserEmailUseReplyTo, $wgEmergencyContact; |
296 | | - global $wgContactUser, $wgContactSender, $wgContactSenderName; |
| 306 | + global $wgContactUser, $wgContactSender, $wgContactSenderName, $wgContactIncludeIP; |
297 | 307 | |
298 | 308 | $csender = $wgContactSender ? $wgContactSender : $wgEmergencyContact; |
299 | 309 | $cname = $wgContactSenderName; |
— | — | @@ -319,19 +329,20 @@ |
320 | 330 | $subject = wfMsgForContent( 'contactpage-defsubject' ); |
321 | 331 | } |
322 | 332 | |
| 333 | + $includeIP = $wgContactIncludeIP && $this->includeIP; |
323 | 334 | if ( $this->fromname !== '' ) { |
324 | | - if ( $wgContactIncludeIP ) { |
| 335 | + if ( $includeIP ) { |
325 | 336 | $subject = wfMsgForContent( 'contactpage-subject-and-sender-withip', $subject, $this->fromname, $senderIP ); |
326 | 337 | } else { |
327 | 338 | $subject = wfMsgForContent( 'contactpage-subject-and-sender', $subject, $this->fromname ); |
328 | 339 | } |
329 | 340 | } elseif ( $this->fromaddress !== '' ) { |
330 | | - if ( $wgContactIncludeIP ) { |
| 341 | + if ( $includeIP ) { |
331 | 342 | $subject = wfMsgForContent( 'contactpage-subject-and-sender-withip', $subject, $this->fromaddress, $senderIP ); |
332 | 343 | } else { |
333 | 344 | $subject = wfMsgForContent( 'contactpage-subject-and-sender', $subject, $this->fromaddress ); |
334 | 345 | } |
335 | | - } else if ( $wgContactIncludeIP ) { |
| 346 | + } else if ( $includeIP ) { |
336 | 347 | $subject = wfMsgForContent( 'contactpage-subject-and-sender', $subject, $senderIP ); |
337 | 348 | } |
338 | 349 | |
Index: trunk/extensions/ContactPage/ContactPage.i18n.php |
— | — | @@ -33,6 +33,7 @@ |
34 | 34 | 'contactpage-formfootnotes-required' => 'All fields are required.', |
35 | 35 | 'contactpage-captcha' => 'To send the message, please solve the captcha ([[Special:Captcha/help|more info]])', |
36 | 36 | 'contactpage-captcha-failed' => 'Captcha test failed! ([[Special:Captcha/help|more info]])', |
| 37 | + 'contactpage-includeip' => 'Include my IP address in this message.', |
37 | 38 | ); |
38 | 39 | |
39 | 40 | /** Message documentation (Message documentation) |
— | — | @@ -1344,6 +1345,7 @@ |
1345 | 1346 | 'contactpage-formfootnotes-required' => 'Alle velden zijn verplicht.', |
1346 | 1347 | 'contactpage-captcha' => 'Om het bericht te versturen, moet u eerst de captcha oplossen ([[Special:Captcha/help|meer informatie]])', |
1347 | 1348 | 'contactpage-captcha-failed' => 'De captcha-test is mislukt! ([[Special:Captcha/help|meer informatie]])', |
| 1349 | + 'contactpage-includeip' => 'Stuur mijn IP-adres mee met dit bericht.', |
1348 | 1350 | ); |
1349 | 1351 | |
1350 | 1352 | /** Norwegian Nynorsk (Norsk (nynorsk)) |
Index: trunk/extensions/ContactPage/ContactPage.php |
— | — | @@ -47,5 +47,5 @@ |
48 | 48 | // on Special:Contact. |
49 | 49 | $wgContactRequireAll = false; |
50 | 50 | |
51 | | -// If true, the IP address of the submitter will be put in the subject line |
| 51 | +// If true, the form will include a checkbox offering to put the IP address of the submitter in the subject line |
52 | 52 | $wgContactIncludeIP = false; |