ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true
),
- 'token' => array(
- ApiBase::PARAM_TYPE => 'string',
- ApiBase::PARAM_REQUIRED => true
- ),
'ccme' => false,
);
}
'target' => 'User to send email to',
'subject' => 'Subject header',
'text' => 'Mail body',
- 'token' => 'A token previously acquired via prop=info',
'ccme' => 'Send a copy of this mail to me',
);
}
- public function getResultProperties() {
- return array(
- '' => array(
- 'result' => array(
- ApiBase::PROP_TYPE => array(
- 'Success',
- 'Failure'
- ),
- ),
- 'message' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- )
- )
- );
- }
-
public function getDescription() {
return 'Email a user.';
}
- public function getPossibleErrors() {
- return array_merge( parent::getPossibleErrors(), array(
- array( 'usermaildisabled' ),
- ) );
- }
-
public function needsToken() {
- return true;
- }
-
- public function getTokenSalt() {
- return '';
+ return 'csrf';
}
public function getExamples() {
return array(
- 'api.php?action=emailuser&target=WikiSysop&text=Content' => 'Send an email to the User "WikiSysop" with the text "Content"',
+ 'api.php?action=emailuser&target=WikiSysop&text=Content&token=123ABC'
+ => 'Send an email to the User "WikiSysop" with the text "Content"',
);
}