- if ( $wgEmailAuthentication ) {
- if ( $user->getEmail() ) {
- if( $user->getEmailAuthenticationTimestamp() ) {
- // date and time are separate parameters to facilitate localisation.
- // $time is kept for backward compat reasons.
- // 'emailauthenticated' is also used in SpecialConfirmemail.php
- $time = $wgLang->timeAndDate( $user->getEmailAuthenticationTimestamp(), true );
- $d = $wgLang->date( $user->getEmailAuthenticationTimestamp(), true );
- $t = $wgLang->time( $user->getEmailAuthenticationTimestamp(), true );
- $emailauthenticated = htmlspecialchars(wfMsg('emailauthenticated', $time, $d, $t )).'<br />';
- $disableEmailPrefs = false;
+ global $wgEmailConfirmToEdit;
+
+ $defaultPreferences['emailaddress'] =
+ array(
+ 'type' => $wgAuth->allowPropChange( 'emailaddress' ) ? 'email' : 'info',
+ 'default' => $user->getEmail(),
+ 'section' => 'personal/email',
+ 'label-message' => 'youremail',
+ 'help-message' => $wgEmailConfirmToEdit
+ ? 'prefs-help-email-required'
+ : 'prefs-help-email',
+ 'validation-callback' => array( 'Preferences', 'validateEmail' ),
+ );
+
+ global $wgEnableUserEmail, $wgEmailAuthentication;
+
+ $disableEmailPrefs = false;
+
+ if ( $wgEmailAuthentication ) {
+ if ( $user->getEmail() ) {
+ if( $user->getEmailAuthenticationTimestamp() ) {
+ // date and time are separate parameters to facilitate localisation.
+ // $time is kept for backward compat reasons.
+ // 'emailauthenticated' is also used in SpecialConfirmemail.php
+ $time = $wgLang->timeAndDate( $user->getEmailAuthenticationTimestamp(), true );
+ $d = $wgLang->date( $user->getEmailAuthenticationTimestamp(), true );
+ $t = $wgLang->time( $user->getEmailAuthenticationTimestamp(), true );
+ $emailauthenticated = wfMsgExt( 'emailauthenticated', 'parseinline',
+ array($time, $d, $t ) ) . '<br />';
+ $disableEmailPrefs = false;
+ } else {
+ $disableEmailPrefs = true;
+ $skin = $wgUser->getSkin();
+ $emailauthenticated = wfMsgExt( 'emailnotauthenticated', 'parseinline' ) . '<br />' .
+ $skin->link(
+ SpecialPage::getTitleFor( 'Confirmemail' ),
+ wfMsg( 'emailconfirmlink' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ ) . '<br />';
+ }