Commit graph

48 commits

Author SHA1 Message Date
Alexandre Emsenhuber
a3d9f524db Removed usage of global objects in SpecialEmailUser
* Added $context parameter to SpecialEmailUser::submit() to replace usage of $wgUser and wfMsg*() calls; added SpecialEmailUser::uiSubmit() as wrapper for HTMLForm submission and updated the call in ApiEmailUser
* Use local context to get messages

Change-Id: Id5a7330486b9ccd5325293590eeefeba1c0f0536
2012-04-13 13:05:36 +02:00
Max Semenik
c7bc27d5f8 Consistency: made all API examples a verbs 2012-01-12 17:36:06 +00:00
Sam Reed
6115b93df8 Re-instate most of the revisions for bug 33147 "API examples should explain what they do"
Using this to sync up my working copies

Should have the little niggles tidied up though
2011-12-27 16:22:35 +00:00
Brion Vibber
02bb594ac7 Revert r106521: creates lots of long, unwrappable lines in help output 2011-12-20 21:26:57 +00:00
Sam Reed
b0818acd86 More example conversions/additions
Ping r106439
2011-12-17 19:10:33 +00:00
Sam Reed
53000baecf Oh noes, moar http:// -> https:// 2011-11-28 15:43:11 +00:00
John Du Hart
2e7d867478 Removed the 'eclipse helper' bit on top of every API module
It's a parctice that dates back to 2006 when the API was first written, and frankly isn't covered by the coding conventions. Same thing with the docblocks, they're all copypasted with some bits changed and don't even make sense if you look at them in the genereated code docs.
I don't feel that any of us depend on this anymore (get a better IDE), so in the inerest of consistancy it's time we said goodbye to it.
2011-11-16 00:17:26 +00:00
John Du Hart
40f19e6def Adding context to the API
This will probably break something somewhere so when it does please yell at me on IRC and I'll fix it.
2011-10-26 23:27:01 +00:00
Sam Reed
a5628f5734 Based on diff to wikia, set more functions consistently public rather than protected 2011-08-17 22:24:21 +00:00
Sam Reed
6e84e9ccd9 Followup r92396, add help urls for most of the core (non query) modules 2011-07-17 16:38:24 +00:00
Brian Wolff
b5c30abacb (bug 27862; follow-up r77714) Make emailuser api module not freak out when SpecialEmailUser returns a status object instead of true. 2011-03-05 03:35:49 +00:00
Sam Reed
6309c920dd Delete all the "API for MediaWiki 1.8+" comments
Add since to ApiQueryQueryPage
2010-12-22 20:52:06 +00:00
Sam Reed
42b5c265c0 * (bug 25248) API: paraminfo errors with certain modules
Added a needsToken() function, rather than calling getTokenSalt, which can throw silly errors due to dependencies on parameters
2010-10-01 20:12:50 +00:00
Alexandre Emsenhuber
457eb73b61 Standardised file description headers, added @file 2010-08-07 19:59:42 +00:00
Sam Reed
f77fff0ffb Followup r70461 if PARAM_REQUIRED is set, use for missing param in getPossibleErrors in ApiBase
All but ApiQueryBacklinks
2010-08-04 19:20:15 +00:00
X!
1afd723c5b Followup to r70460 and r70461: Use true instead of 1 2010-08-04 14:29:39 +00:00
X!
8b466d3d0d Followup to r70460: Committed wrong version of ApiBase.php, convert all core API modules to PARAM_REQUIRED syntax 2010-08-04 14:15:33 +00:00
Platonides
1af741ee27 Use the canonical names for classes. 2010-07-27 18:33:04 +00:00
Derk-Jan Hartman
921619b119 Correct the address of the FSF in some of the GPL headers
59 Temple Place -> 51 Franklin Street
2010-06-21 13:13:32 +00:00
Sam Reed
50b88a5b1b Remove arrays from getDescription where we are only using 1 line 2010-05-25 20:46:09 +00:00
Sam Reed
e55ed729c4 Mixture of things.
Couple of class comments

Normalisation of "." usage at end of lines (removed)

Normalisation of {prefix}parameter as per bug 23461
2010-05-11 22:30:18 +00:00
Sam Reed
0769301e87 Stylize Api upto date 2010-04-17 20:58:04 +00:00
Happy-melon
38c7c8f895 Overhaul Special:EmailUser, use HTMLForm, a SpecialPage-derived class, and general tidy up. Message change got muddled into r64901. 2010-04-10 21:14:35 +00:00
Jack Phoenix
582afa7e2a ApiEmailUser.php: fix copyright symbol, spacing and coding style tweaks, spaces -> tabs, trimmed off trailing whitespace 2010-02-22 12:20:54 +00:00
Sam Reed
878c7da630 Followup to r62557 as per Roans comment 2010-02-16 21:59:16 +00:00
Sam Reed
0e8b0b41ac Refactor requiresToken to getTokenSalt - Returns salt if exists, null if no salt, else false if no token required
Move sessionfailure (token validation checking) up a couple of levels

Part of bug 21991

Followup to r62482 and r62504
2010-02-15 23:53:43 +00:00
Sam Reed
80f9448690 Start of "Bug 21991 - Move common query parameter (uc, rc) validation, token requiringness/checking to ApiBase/Similar"
Move token requringness check to the ApiMain

Adding an exception if we're using "gettoken" (block/unblock)

Remove array( 'missingparam', 'token' ), from the getPossibleErrors of modules that set requireToken method to true
2010-02-14 22:20:27 +00:00
Sam Reed
bd1a643e6e Change layout of the mustBePosted format to standardise it 2010-02-14 21:12:11 +00:00
Sam Reed
d2d950d256 Start of blanket coverage of dieUsageMsg in getPossibleErrors
Only basic ones done.

Couple of other modules done manually
2010-02-13 00:09:05 +00:00
Sam Reed
47c24175d3 Add/remove whitelines to increase readability in API code files 2010-01-23 22:26:40 +00:00
Aryeh Gregor
3758769f0d stylize.php on API code
"I wouldn't object to stylizing the API code to bring it in line with
the rest of MW on principle, but I'm not gonna bother myself." --Roan
<http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60657#c5108>

If you're seeing this commit in blames, tell your blame tool to ignore
whitespace, e.g., git blame -w or svn blame -x -w.
2010-01-11 15:55:52 +00:00
Roan Kattouw
21fd7af97e * API: (bug 17774) API pretends action=query doesn't exist for users without read rights
* Instead of hiding read-restricted modules, throw an error when a user without read rights tries to use them
* Do the same for write modules when $wgEnableWriteAPI is false
* Indicate whether a module needs read or write rights in action=help and action=paraminfo
* BREAKING CHANGE: action=purge now requires write rights and, for anonymous users, a POST request
2009-03-06 13:49:44 +00:00
Roan Kattouw
8e361227a2 Revert r46512 (Add "check" parameter to action=email) and its followups r46515 and r46517. This functionality is already present in list=users (as usprop=emailable), where it belongs 2009-01-31 13:20:36 +00:00
Bryan Tong Minh
57d7e2bb88 Also return why the target user is not valid 2009-01-29 19:30:18 +00:00
Bryan Tong Minh
7058f802a2 Kill code duplication & other style tweaks 2009-01-29 19:27:44 +00:00
X!
73ba55efd6 Forgot to remove that 2009-01-29 04:13:50 +00:00
X!
38299137f7 Per 46512#c1554, moving check to before required params, returns a result rather than an error, and it must be posted. 2009-01-29 03:23:25 +00:00
X!
a9b78e1db9 Add "check" parameter to action=email 2009-01-29 01:25:17 +00:00
Roan Kattouw
b62ddd3971 API:
* Title::moveTo() has been returning a getUserPermissionsErrors()-like array for ages now, let's use it correctly in ApiMove and skip the double-checks
* Remove some outdated TODO/FIXME comments
2008-09-25 21:39:36 +00:00
Roan Kattouw
b8e624d367 API: Uniformizing descriptions for write modules 2008-09-07 19:12:41 +00:00
Alexandre Emsenhuber
78ca64e449 missing svn:keywords property 2008-09-04 22:20:32 +00:00
Bryan Tong Minh
a9fd7beaef * Fixup validation methods in UserEmailForm a bit so that they don't return arrays when it's not necessary.
* Add email errors to the API's message map
2008-08-27 13:36:39 +00:00
Brion Vibber
be28c3980a Revert r39793 "* (bug 13879) Special:EmailUser shows a form in case no user was specified" for the moment
* Recipient name seems to be output raw into HTML form; this is insecure
* We've lost the link to the target's user page in the primary use case (followed 'email this user' link)
* Behavior if you misspell a name doesn't look very nice; you can't just fix it and resubmit the form, you have to hit 'back' from an error page and hope your browser isn't one that deletes all your form data :D
2008-08-21 22:56:45 +00:00
Bryan Tong Minh
e751a22a2f * (bug 13879) Special:EmailUser shows a form in case no user was specified 2008-08-21 22:15:34 +00:00
Bryan Tong Minh
9cb4023d9f ... and should have also made this an array 2008-06-02 20:15:22 +00:00
Bryan Tong Minh
8da741008c Forgot to return success 2008-06-02 20:11:11 +00:00
Bryan Tong Minh
74c2b22e84 Put ratelimiter and edittoken checking in backend. 2008-06-02 19:15:56 +00:00
Bryan Tong Minh
1a3664ee7e API: Add action=emailuser 2008-06-01 17:58:27 +00:00