Index: trunk/extensions/ConfirmAccount/dataclasses/ConfirmAccount.class.php |
— | — | @@ -119,6 +119,23 @@ |
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
| 123 | + * Get a request name from an email confirmation token |
| 124 | + * |
| 125 | + * @param sring $code |
| 126 | + * @returns string|false |
| 127 | + */ |
| 128 | + public function requestNameFromEmailToken( $code ) { |
| 129 | + $dbr = wfGetDB( DB_SLAVE ); |
| 130 | + return $dbr->selectField( 'account_requests', |
| 131 | + 'acr_name', |
| 132 | + array( |
| 133 | + 'acr_email_token' => md5( $code ), |
| 134 | + 'acr_email_token_expires > ' . $dbr->addQuotes( $dbr->timestamp() ), |
| 135 | + ) |
| 136 | + ); |
| 137 | + } |
| 138 | + |
| 139 | + /** |
123 | 140 | * Verifies that it's ok to include the uploaded file |
124 | 141 | * |
125 | 142 | * @param string $tmpfile the full path of the temporary file to verify |
Index: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php |
— | — | @@ -430,7 +430,7 @@ |
431 | 431 | protected function confirmEmailToken( $code ) { |
432 | 432 | global $wgUser, $wgOut, $wgConfirmAccountContact, $wgPasswordSender; |
433 | 433 | # Confirm if this token is in the pending requests |
434 | | - $name = $this->requestFromEmailToken( $code ); |
| 434 | + $name = ConfirmAccount::requestNameFromEmailToken( $code ); |
435 | 435 | if ( $name !== false ) { |
436 | 436 | # Send confirmation email to prospective user |
437 | 437 | ConfirmAccount::confirmEmail( $name ); |
— | — | @@ -469,20 +469,4 @@ |
470 | 470 | $wgOut->addWikiMsg( 'confirmemail_invalid' ); |
471 | 471 | } |
472 | 472 | } |
473 | | - |
474 | | - /** |
475 | | - * Get a request name from an emailconfirm token |
476 | | - * |
477 | | - * @param sring $code |
478 | | - * @returns string $name |
479 | | - */ |
480 | | - protected function requestFromEmailToken( $code ) { |
481 | | - $dbr = wfGetDB( DB_SLAVE ); |
482 | | - $reqID = $dbr->selectField( 'account_requests', 'acr_name', |
483 | | - array( 'acr_email_token' => md5( $code ), |
484 | | - 'acr_email_token_expires > ' . $dbr->addQuotes( $dbr->timestamp() ), |
485 | | - ) |
486 | | - ); |
487 | | - return $reqID; |
488 | | - } |
489 | 473 | } |