r49920 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49919‎ | r49920 | r49921 >
Date:01:38, 27 April 2009
Author:werdna
Status:resolved (Comments)
Tags:
Comment:
Made email option actually work, fixed bug 18580 (new preferences page does not display email confirmation data)
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Preferences.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -2499,6 +2499,7 @@
25002500 'noconvertlink' => 0,
25012501 'gender' => 'unknown',
25022502 'ccmeonemails' => 0,
 2503+ 'disablemail' => 0,
25032504 );
25042505
25052506 /** Whether or not to allow and use real name fields. Defaults to true. */
Index: trunk/phase3/includes/Preferences.php
@@ -220,11 +220,44 @@
221221
222222 ## Email #######################################
223223 ## Email stuff
224 - global $wgEnableEmail, $wgEnableUserEmail;
 224+ global $wgEnableEmail, $wgEnableUserEmail, $wgEmailAuthentication;
 225+
 226+ if ( $wgEmailAuthentication ) {
 227+ if ( $user->getEmail() ) {
 228+ if( $user->getEmailAuthenticationTimestamp() ) {
 229+ // date and time are separate parameters to facilitate localisation.
 230+ // $time is kept for backward compat reasons.
 231+ // 'emailauthenticated' is also used in SpecialConfirmemail.php
 232+ $time = $wgLang->timeAndDate( $user->getEmailAuthenticationTimestamp(), true );
 233+ $d = $wgLang->date( $user->getEmailAuthenticationTimestamp(), true );
 234+ $t = $wgLang->time( $user->getEmailAuthenticationTimestamp(), true );
 235+ $emailauthenticated = wfMsg('emailauthenticated', $time, $d, $t ).'<br />';
 236+ $disableEmailPrefs = false;
 237+ } else {
 238+ $disableEmailPrefs = true;
 239+ $skin = $wgUser->getSkin();
 240+ $emailauthenticated = wfMsg('emailnotauthenticated').'<br />' .
 241+ $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Confirmemail' ),
 242+ wfMsg( 'emailconfirmlink' ) ) . '<br />';
 243+ }
 244+ } else {
 245+ $emailauthenticated = wfMsg( 'noemailprefs' );
 246+ }
 247+
 248+ $defaultPreferences['emailauthentication'] =
 249+ array(
 250+ 'type' => 'info',
 251+ 'raw' => true,
 252+ 'section' => 'email',
 253+ 'label-message' => 'prefs-emailconfirm-label',
 254+ 'default' => $emailauthenticated,
 255+ );
 256+
 257+ }
 258+
225259 if ($wgEnableEmail) {
226 -
227260 if ($wgEnableUserEmail) {
228 - $defaultPreferences['disableemail'] =
 261+ $defaultPreferences['disablemail'] =
229262 array(
230263 'type' => 'toggle',
231264 'invert' => true,
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1611,6 +1611,7 @@
16121612 'prefs-custom-js' => 'Custom JS',
16131613 'prefs-reset-intro' => 'You can use this page to reset your preferences to the site defaults.
16141614 This cannot be undone.',
 1615+'prefs-emailconfirm-label' => 'Email confirmation:',
16151616
16161617 # User rights
16171618 'userrights' => 'User rights management',

Follow-up revisions

RevisionCommit summaryAuthorDate
r49929Follow-up on r49920....siebrand05:38, 27 April 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   18:41, 27 April 2009

It's showing me the "changed your email, sent you a confirmation" wayyyy too often -- on every submit as far as I can tell, even if the email field is blank!

Status & tagging log