From: Mark A. Hershberger Date: Fri, 30 Sep 2011 20:36:52 +0000 (+0000) Subject: re r92924 andFix Bug #31283 - "Change E-mail" option in Preference should be hidden X-Git-Tag: 1.31.0-rc.0~27342 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=a81a0b18440d6c417a0feab298b4927a03b4c4a9;p=lhc%2Fweb%2Fwiklou.git re r92924 andFix Bug #31283 - "Change E-mail" option in Preference should be hidden when AuthPlugin#allowEmailChange() returns false Patch from Rusty Burchfield --- diff --git a/CREDITS b/CREDITS index a792447065..444d27ad35 100644 --- a/CREDITS +++ b/CREDITS @@ -147,6 +147,7 @@ following names for their contribution to the product. * rgcjonas * Robert Treat * RockMFR +* Rusty Burchfield * Salvatore Ingala * Scott Colcord * Simon Walker diff --git a/includes/Preferences.php b/includes/Preferences.php index a955b6fb5d..69fd1b7d36 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -356,12 +356,15 @@ class Preferences { array(), array( 'returnto' => SpecialPage::getTitleFor( 'Preferences' ) ) ); + $emailAddress = $user->getEmail() ? htmlspecialchars( $user->getEmail() ) : ''; + if ( $wgAuth->allowPropChange( 'emailaddress' ) ) { + $emailAddress .= $emailAddress == '' ? $link : " ($link)"; + } + $defaultPreferences['emailaddress'] = array( 'type' => 'info', 'raw' => true, - 'default' => $user->getEmail() - ? htmlspecialchars( $user->getEmail() ) . " ($link)" - : $link, + 'default' => $emailAddress, 'label-message' => 'youremail', 'section' => 'personal/email', );