X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiEmailUser.php;h=d35b848bc1c1d20ee137fdf2b10726c37b3e558e;hb=2bd577d312ddfc1c97afd62794f240eb3129ebfb;hp=29f7e056e91a4cc8900427147cf621aebf618078;hpb=11cb289cfc45fd40056bccae208934b11c98c10e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiEmailUser.php b/includes/api/ApiEmailUser.php index 29f7e056e9..d35b848bc1 100644 --- a/includes/api/ApiEmailUser.php +++ b/includes/api/ApiEmailUser.php @@ -94,10 +94,6 @@ class ApiEmailUser extends ApiBase { ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_REQUIRED => true ), - 'token' => array( - ApiBase::PARAM_TYPE => 'string', - ApiBase::PARAM_REQUIRED => true - ), 'ccme' => false, ); } @@ -107,49 +103,21 @@ class ApiEmailUser extends ApiBase { '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' + 'api.php?action=emailuser&target=WikiSysop&text=Content&token=123ABC' => 'Send an email to the User "WikiSysop" with the text "Content"', ); }