diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
commit | c9aa36da061816dee256a979c2ff8d2ee41824d9 (patch) | |
tree | 29f7002b80ee984b488bd047dbbd80b36bf892e9 /includes/api/ApiEmailUser.php | |
parent | b4274e0e33eafb5e9ead9d949ebf031a9fb8363b (diff) | |
parent | d1ba966140d7a60cd5ae4e8667ceb27c1a138592 (diff) |
Merge branch 'archwiki'
# Conflicts:
# skins/ArchLinux.php
# skins/ArchLinux/archlogo.gif
Diffstat (limited to 'includes/api/ApiEmailUser.php')
-rw-r--r-- | includes/api/ApiEmailUser.php | 43 |
1 files changed, 8 insertions, 35 deletions
diff --git a/includes/api/ApiEmailUser.php b/includes/api/ApiEmailUser.php index cd0d0cba..9870b2de 100644 --- a/includes/api/ApiEmailUser.php +++ b/includes/api/ApiEmailUser.php @@ -40,7 +40,11 @@ class ApiEmailUser extends ApiBase { } // Check permissions and errors - $error = SpecialEmailUser::getPermissionsError( $this->getUser(), $params['token'] ); + $error = SpecialEmailUser::getPermissionsError( + $this->getUser(), + $params['token'], + $this->getConfig() + ); if ( $error ) { $this->dieUsageMsg( array( $error ) ); } @@ -94,10 +98,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 +107,22 @@ 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' => '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"', ); } |