r98985 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98984‎ | r98985 | r98986 >
Date:07:36, 5 October 2011
Author:aaron
Status:deferred
Tags:
Comment:
* Added missing rollback() call to db in doAccountConfirmSubmit()
* Added UserAccountRequest::newFromId() function to be used later
Modified paths:
  • /trunk/extensions/ConfirmAccount/business/AccountRequestSubmission.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/dataclasses/UserAccountRequest.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmAccount/dataclasses/UserAccountRequest.php
@@ -109,6 +109,22 @@
110110 }
111111
112112 /**
 113+ * @param $id int
 114+ * @param $from string|null 'master' to use DB master
 115+ * @return UserAccountRequest
 116+ */
 117+ public static function newFromId( $id, $from = null ) {
 118+ $db = ( $master == 'dbmaster' )
 119+ ? wfGetDB( DB_MASTER )
 120+ : wfGetDB( DB_SLAVE );
 121+ $row = $db->selectRow( 'account_requests', array( 'acr_id' => $id ), __METHOD__ );
 122+ if ( !$row ) {
 123+ return null;
 124+ }
 125+ return self::newFromRow( $row );
 126+ }
 127+
 128+ /**
113129 * @return int
114130 */
115131 public function getId() {
Index: trunk/extensions/ConfirmAccount/business/AccountRequestSubmission.php
@@ -42,6 +42,9 @@
4343 $this->attachmentTempPath = $params['attachmentTempPath'];
4444 }
4545
 46+ /**
 47+ * @return string
 48+ */
4649 public function getAttachmentDidNotForget() {
4750 return $this->attachmentDidNotForget;
4851 }
Index: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php
@@ -480,6 +480,7 @@
481481 if( !$result->isOk() ) {
482482 $error = wfMsg( 'mailerror', $out->parse( $result->getWikiText() ) );
483483 $this->showAccountConfirmForm( $error );
 484+ $dbw->rollback();
484485 return false;
485486 }
486487 }

Status & tagging log