[Mediawiki-l] enable email but disable email change.

GF ganfab at gmail.com
Thu May 8 12:41:36 UTC 2008


I am creating a custom authentication plugin.
The user email is loaded from an external source and it is stored in the
mediawiki DB.

The problem is that if  a user go to his preferences page, it will have the
chance to change his email address.

Looking in specialPreferences.php I have found this:

        if ( $wgEnableEmail ) {

            $moreEmail = '';
            if ($wgEnableUserEmail) {
                $emf = wfMsg( 'allowemail' );
                $disabled = $disableEmailPrefs ? ' disabled="disabled"' :
'';
                $moreEmail =
                "<input type='checkbox' $emfc $disabled value='1'
name='wpEmailFlag' id='wpEmailFlag' /> <label
for='wpEmailFlag'>$emf</label>";
            }


            $wgOut->addHTML(
                $this->tableRow( Xml::element( 'h2', null, wfMsg( 'email' )
) ) .
                $this->tableRow(
                    $emailauthenticated.
                    $enotifrevealaddr.
                    $enotifwatchlistpages.
                    $enotifusertalkpages.
                    $enotifminoredits.
                    $moreEmail.
                    $this->getToggle( 'ccmeonemails' )
                )
            );
        }

Seems that if I enabled the email with ($wgEnableEmail) the from will print
the email form element to change it.

IS there any way for doing what I need (apart modifying brutally the
specialPreferences.php?

Thank you


More information about the MediaWiki-l mailing list