Don't shown red box around unconfirmed email address in preferences if authentication is disabled

Susan and Base-w in #wikimedia discovered that a red box is always shown around
their email address on foundationwiki. This is because the box is shown by
default - even when email address authentication is disabled.

Change-Id: I0b906b23dec6018bc21a179e2cf950b705100c4c
This commit is contained in:
Alex Monk 2013-05-10 22:05:22 +01:00 committed by Gerrit Code Review
parent 7cf26c770d
commit d2a5cf3580

View file

@ -409,8 +409,8 @@ class Preferences {
$disableEmailPrefs = false;
$emailauthenticationclass = 'mw-email-not-authenticated';
if ( $wgEmailAuthentication ) {
$emailauthenticationclass = 'mw-email-not-authenticated';
if ( $user->getEmail() ) {
if ( $user->getEmailAuthenticationTimestamp() ) {
// date and time are separate parameters to facilitate localisation.
@ -449,8 +449,8 @@ class Preferences {
# Apply the same CSS class used on the input to the message:
'cssclass' => $emailauthenticationclass,
);
$defaultPreferences['emailaddress']['cssclass'] = $emailauthenticationclass;
}
$defaultPreferences['emailaddress']['cssclass'] = $emailauthenticationclass;
if ( $wgEnableUserEmail && $user->isAllowed( 'sendemail' ) ) {
$defaultPreferences['disablemail'] = array(