http://www.mediawiki.org/wiki/Special:Code/MediaWiki/98105
Revision: 98105
Author: aaron
Date: 2011-09-26 02:22:21 +0000 (Mon, 26 Sep 2011)
Log Message:
-----------
Moved sendConfirmationMail() to ConfirmAccount.class.php
Modified Paths:
--------------
trunk/extensions/ConfirmAccount/dataclasses/ConfirmAccount.class.php
trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php
Modified: trunk/extensions/ConfirmAccount/dataclasses/ConfirmAccount.class.php
===================================================================
--- trunk/extensions/ConfirmAccount/dataclasses/ConfirmAccount.class.php
2011-09-26 02:07:32 UTC (rev 98104)
+++ trunk/extensions/ConfirmAccount/dataclasses/ConfirmAccount.class.php
2011-09-26 02:22:21 UTC (rev 98105)
@@ -92,6 +92,33 @@
}
/**
+ * Generate a new e-mail confirmation token and send a confirmation
+ * mail to the user's given address.
+ *
+ * @param User $user
+ * @param string $ip User IP address
+ * @param string $token
+ * @param string $expiration
+ * @return mixed True on success, a Status object on failure.
+ */
+ public static function sendConfirmationMail( User $user, $ip, $token,
$expiration ) {
+ global $wgContLang;
+ $url = self::confirmationTokenUrl( $token );
+ $lang = $user->getOption( 'language' );
+ return $user->sendMail(
+ wfMessage( 'requestaccount-email-subj' )->inLanguage(
$lang )->text(),
+ wfMessage( 'requestaccount-email-body',
+ $ip,
+ $user->getName(),
+ $url,
+ $wgContLang->timeanddate( $expiration, false ) ,
+ $wgContLang->date( $expiration, false ) ,
+ $wgContLang->time( $expiration, false )
+ )->inLanguage( $lang )->text()
+ );
+ }
+
+ /**
* Verifies that it's ok to include the uploaded file
*
* @param string $tmpfile the full path of the temporary file to verify
Modified:
trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php
===================================================================
---
trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php
2011-09-26 02:07:32 UTC (rev 98104)
+++
trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php
2011-09-26 02:22:21 UTC (rev 98105)
@@ -372,7 +372,7 @@
$dbw->begin();
$req->insertOn();
# Send confirmation, required!
- $result = $this->sendConfirmationMail( $u, $token, $expires );
+ $result = ConfirmAccount::sendConfirmationMail( $u, wfGetIP(),
$token, $expires );
if ( !$result->isOK() ) {
$dbw->rollback(); // Nevermind
$error = wfMsg( 'mailerror', $wgOut->parse(
$result->getWikiText() ) );
@@ -485,26 +485,4 @@
);
return $reqID;
}
-
- /**
- * Generate a new e-mail confirmation token and send a confirmation
- * mail to the user's given address.
- *
- * @param User $user
- * @param string $token
- * @param string $expiration
- * @return mixed True on success, a Status object on failure.
- */
- protected function sendConfirmationMail( $user, $token, $expiration ) {
- global $wgContLang;
- $url = ConfirmAccount::confirmationTokenUrl( $token );
- return $user->sendMail( wfMsg( 'requestaccount-email-subj' ),
- wfMsg( 'requestaccount-email-body',
- wfGetIP(),
- $user->getName(),
- $url,
- $wgContLang->timeanddate( $expiration, false ) ,
- $wgContLang->date( $expiration, false ) ,
- $wgContLang->time( $expiration, false ) ) );
- }
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs