diff options
author | Brad Jorsch <bjorsch@wikimedia.org> | 2014-08-08 17:56:07 +0100 |
---|---|---|
committer | Brad Jorsch <bjorsch@wikimedia.org> | 2014-08-26 14:53:45 -0400 |
commit | fdddf94570efc33fd06f16c72d41636a45cf203a (patch) | |
tree | 92568e71339b40e72971a30bfb818422daddc13f /includes/api/ApiEmailUser.php | |
parent | b728d6920b05c8b667651f7e99d749496474f02b (diff) | |
download | mediawikicore-fdddf94570efc33fd06f16c72d41636a45cf203a.tar.gz mediawikicore-fdddf94570efc33fd06f16c72d41636a45cf203a.zip |
API: Overhaul token handling
The current token handling is a mess. This simplifies things greatly:
* *All* tokens are obtained from action=query&meta=tokens, rather than
being spread over action=tokens, action=query&prop=info,
action=query&prop=revisions, action=query&prop=recentchanges, and
action=query&prop=users. All these old methods are deprecated.
* Similarly, there is only one hook to register new token types. All old
hooks are deprecated.
* All tokens are cacheable.
* Most token types are dropped in favor of a 'csrf' token. They already
were returning the same token anyway.
* All token-using modules will document the required token type in a
standard manner in action=help and are documented in machine-readable
fashion in action=paraminfo.
Note this will require updates to all extensions using tokens.
Change-Id: I2793a3f2dd64a4bebb0b4d065e09af1e9f63fb89
Diffstat (limited to 'includes/api/ApiEmailUser.php')
-rw-r--r-- | includes/api/ApiEmailUser.php | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/includes/api/ApiEmailUser.php b/includes/api/ApiEmailUser.php index 1a4d67d9ffab..d35b848bc1c1 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,7 +103,6 @@ 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', ); } @@ -117,16 +112,12 @@ class ApiEmailUser extends ApiBase { } 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"', ); } |