/*
* Try to set a user's email address.
* This does *not* try to validate the address.
+ * Caller is responsible for checking $wgAuth.
* @param $user User
* @param $newaddr string New email address
* @return Array (true on success or Status on failure, info string)
parent::__construct( 'ChangeEmail' );
}
+ function isListed() {
+ global $wgAuth;
+ return $wgAuth->allowPropChange( 'emailaddress' );
+ }
+
/**
* Main execution point
*/
function execute( $par ) {
+ global $wgAuth;
if ( wfReadOnly() ) {
throw new ReadOnlyError;
}
$user = $this->getUser();
+ if ( !$wgAuth->allowPropChange( 'emailaddress' ) ) {
+ $this->error( wfMsgExt( 'cannotchangeemail', 'parseinline' ) );
+ return;
+ }
+
if ( !$request->wasPosted() && !$user->isLoggedIn() ) {
$this->error( wfMsg( 'changeemail-no-info' ) );
return;
'emailconfirmlink' => 'Confirm your e-mail address',
'invalidemailaddress' => 'The e-mail address cannot be accepted as it appears to have an invalid format.
Please enter a well-formatted address or empty that field.',
+'cannotchangeemail' => 'Account e-mail addresses cannot be changed on this wiki.',
'accountcreated' => 'Account created',
'accountcreatedtext' => 'The user account for $1 has been created.',
'createaccount-title' => 'Account creation for {{SITENAME}}',