creation, so people don't immediately go off to request a second one.
* Add a warning on Special:Confirmemail if a code was already sent and has
not yet expired.
* (bug 8239) correctly get 50 new contributions when clicking '(50 next)'
* (bug 2259) Fix old regression where e-mail addresses were no longer
confirmed on login with mailed password.
+* Add a notification about the confirmation mail sent during account
+ creation, so people don't immediately go off to request a second one.
+* Add a warning on Special:Confirmemail if a code was already sent and has
+ not yet expired.
== Languages updated ==
$time = $wgLang->timeAndDate( $wgUser->mEmailAuthenticated, true );
$wgOut->addWikiText( wfMsg( 'emailauthenticated', $time ) );
}
+ if( $wgUser->isEmailConfirmationPending() ) {
+ $wgOut->addWikiText( wfMsg( 'confirmemail_pending' ) );
+ }
$wgOut->addWikiText( wfMsg( 'confirmemail_text' ) );
$self = SpecialPage::getTitleFor( 'Confirmemail' );
$form = wfOpenElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl() ) );
# Save user settings and send out an email authentication message if needed
$u->saveSettings();
- if( $wgEmailAuthentication && User::isValidEmailAddr( $u->getEmail() ) )
- $u->sendConfirmationMail();
+ if( $wgEmailAuthentication && User::isValidEmailAddr( $u->getEmail() ) ) {
+ global $wgOut;
+ $error = $u->sendConfirmationMail();
+ if( WikiError::isError( $error ) ) {
+ $wgOut->addWikiText( wfMsg( 'confirmemail_sendfailed', $error->getMessage() ) );
+ } else {
+ $wgOut->addWikiText( wfMsg( 'confirmemail_oncreate' ) );
+ }
+ }
# If not logged in, assume the new account as the current one and set session cookies
# then show a "welcome" message or a "need cookies" message as needed
return $confirmed;
}
}
+
+ /**
+ * Return true if there is an outstanding request for e-mail confirmation.
+ * @return bool
+ */
+ function isEmailConfirmationPending() {
+ global $wgEmailAuthentication;
+ return $wgEmailAuthentication &&
+ !$this->isEmailConfirmed() &&
+ $this->mEmailToken &&
+ $this->mEmailTokenExpires > wfTimestamp();
+ }
/**
* @param array $groups list of groups
before using e-mail features. Activate the button below to send a confirmation
mail to your address. The mail will include a link containing a code; load the
link in your browser to confirm that your e-mail address is valid.",
+'confirmemail_pending' => '<div class="error">
+A confirmation code has already been e-mailed to you; if you recently
+created your account, you may wish to wait a few minutes for it to
+arrive before trying to request a new code.
+</div>',
'confirmemail_send' => 'Mail a confirmation code',
'confirmemail_sent' => 'Confirmation e-mail sent.',
+'confirmemail_oncreate' => 'A confirmation code was sent to your e-mail address.
+This code is not required to log in, but you will need to provide it before
+enabling any e-mail-based features in the wiki.',
'confirmemail_sendfailed' => 'Could not send confirmation mail. Check address for invalid characters.
Mailer returned: $1',