r96860 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96859‎ | r96860 | r96861 >
Date:16:30, 12 September 2011
Author:reedy
Status:ok
Tags:
Comment:
1.17wmf1: MFT r96420, r96627
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/CodeReview/ui/CodeRevisionAuthorView.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/EmailCapture/EmailCapture.i18n.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/EmailCapture/SpecialEmailCapture.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/EmailCapture/EmailCapture.i18n.php
@@ -15,6 +15,8 @@
1616 'emailcapture' => 'Email verification',
1717 'emailcapture-desc' => 'Capture e-mail addresses, and allow users to verify them through e-mail',
1818 'emailcapture-failure' => "Your e-mail was '''not''' verified.",
 19+ 'emailcapture-invalid-code' => 'Invalid confirmation code.',
 20+ 'emailcapture-already-confirmed' => 'Your e-mail address has already been confirmed.',
1921 'emailcapture-response-subject' => '{{SITENAME}} e-mail address verification',
2022 'emailcapture-response-body' => 'Verify your e-mail address by following this link:
2123 $1
Index: branches/wmf/1.17wmf1/extensions/EmailCapture/SpecialEmailCapture.php
@@ -14,16 +14,28 @@
1515 $code = $wgRequest->getVal( 'verify' );
1616 if ( $code !== null ) {
1717 $dbw = wfGetDB( DB_MASTER );
18 - $dbw->update(
 18+ $row = $dbw->selectRow(
1919 'email_capture',
20 - array( 'ec_verified' => 1 ),
 20+ array( 'ec_verified' ),
2121 array( 'ec_code' => $code ),
2222 __METHOD__
2323 );
24 - if ( $dbw->affectedRows() ) {
25 - $wgOut->addWikiMsg( 'emailcapture-success' );
 24+ if ( $row && !$row->ec_verified ) {
 25+ $dbw->update(
 26+ 'email_capture',
 27+ array( 'ec_verified' => 1 ),
 28+ array( 'ec_code' => $code ),
 29+ __METHOD__
 30+ );
 31+ if ( $dbw->affectedRows() ) {
 32+ $wgOut->addWikiMsg( 'emailcapture-success' );
 33+ } else {
 34+ $wgOut->addWikiMsg( 'emailcapture-failure' );
 35+ }
 36+ } else if ( $row && $row->ec_verified ) {
 37+ $wgOut->addWikiMsg( 'emailcapture-already-confirmed' );
2638 } else {
27 - $wgOut->addWikiMsg( 'emailcapture-failure' );
 39+ $wgOut->addWikiMsg( 'emailcapture-invalid-code' );
2840 }
2941 } else {
3042 // Show simple form for submitting verification code
Index: branches/wmf/1.17wmf1/extensions/CodeReview/ui/CodeRevisionAuthorView.php
@@ -19,7 +19,12 @@
2020
2121 return wfMsgHtml( 'code-author-haslink',
2222 $this->skin->userLink( $this->mUser->getId(), $this->mUser->getName() ) .
23 - $this->skin->userToolLinks( $this->mUser->getId(), $this->mUser->getName() ) );
 23+ $this->skin->userToolLinks(
 24+ $this->mUser->getId(),
 25+ $this->mUser->getName(),
 26+ false, /* default for redContribsWhenNoEdits */
 27+ Linker::TOOL_LINKS_EMAIL /* Add "send e-mail" link */
 28+ ) );
2429 }
2530
2631 function execute() {

Follow-up revisions

RevisionCommit summaryAuthorDate
r96864Revert Linker.php in r96858, r96856...reedy16:49, 12 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96420Add constant Linker::TOOL_LINKS_EMAIL to allow adding a "send e-mail" link fr...siebrand12:12, 7 September 2011
r96627* (bug 30823) Clarify error messages on Special:EmailCapture...brion22:47, 8 September 2011

Status & tagging log