Commit graph

63 commits

Author SHA1 Message Date
Reedy
c87a63935a Merge "(bug 19195) Make user IDs more readily available with the API" 2012-05-10 18:47:42 +00:00
Szymon Świerkosz
7cf5f38232 Move optionstoken from meta=userinfo to action=tokens.
Follow up to I0d6c654a7354ba77e65e338423952a6a78c1150f.
I have also added a URL to a help page on mw.org.

Change-Id: Ie223930cfc313aff150e2dcfd70b74bf4360a8a8
2012-05-06 16:07:17 +02:00
Werdna
a97f5a1134 Merge "(bug 18195) Allow changing preferences via API" 2012-05-04 05:53:06 +00:00
Alex Monk
e02bea0f8b Done a bit of deglobalisation.
Change-Id: Id6e5e18b7bcaecd042528fdb37774a64e439e907
2012-04-24 15:40:37 +01:00
umherirrender
426ccbf42e (bug 19195) Make user IDs more readily available with the API
Add some block ids and user ids to the result of some modules

Change-Id: If50604b888a54827eddde76574e779db6c7263ec
2012-04-22 14:20:46 +02:00
Szymon Świerkosz
a6cd69d83a (bug 18195) Allow changing preferences via API
I have created an API module for changing the preferences.
It allows resetting preferences (reset argument) and bulk changes
of preferences (change argument) in a format:
name1=value1|name2=value2

The change argument has a limitation imposed by the current API
implementation as it cannot accept | in values. There is
available a pair of arguments optionname and optionvalue, the
latter accepts values with |.

I have created optionstoken parameter in meta=userinfo to provide
a token. There is already preferencestoken there, but I would
like to have a consistent naming.

Change-Id: I0d6c654a7354ba77e65e338423952a6a78c1150f
2012-04-20 16:56:27 +10: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
Sam Reed
fa65fa3243 Documentation
Deprecated code updates
2011-10-27 00:46:17 +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
ef861c14ba Followup r98329
Change ApiQueryInfo to match also
2011-09-28 17:01:53 +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
d5e46f9614 Followup r92396
More modules documented, pretty much only action=query&list= to be done (ie links added where documentation pages exist already)
2011-07-17 16:51:11 +00:00
Sam Reed
00f0594736 * (bug 28364) add registration date to meta=userinfo 2011-04-10 12:27:32 +00:00
Alexandre Emsenhuber
7fc4255afe Seems I forgot this file in r85442 2011-04-05 16:28:38 +00:00
Daniel Friesen
c49946aa39 Followup r79433, hide realname from output when realnames are a hidden pref. 2011-03-28 03:25:36 +00:00
Alexandre Emsenhuber
60f1302644 Per Platonides, fix for r82686: make ApiUploadTest work again
Added option request parameter to User::editToken() and User::matchEditToken() and use them where possible from the api.
Also removed $_SESSION usage since it's no longer needed
2011-03-02 12:52:47 +00:00
Sam Reed
e1bcab1ab8 * (bug 25767) Add userrights properties to allusers and users query lists
First part of this bug. Listing of all rights that users have
2011-01-04 01:39:02 +00:00
Daniel Friesen
5b68a32d07 Add a realname option to query=userinfo in the api. 2011-01-01 17:38:15 +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
a7b545fb40 Tab out for alignment, and normalise capitalisation of first letters 2010-11-03 17:01:21 +00:00
Sam Reed
3013d5baf6 Few explicit class variable definitions 2010-10-01 11:21:46 +00:00
Sam Reed
86fd539c32 Remove some unused variables
Add some braces
2010-09-20 14:32:38 +00:00
Alexandre Emsenhuber
457eb73b61 Standardised file description headers, added @file 2010-08-07 19:59:42 +00:00
Sam Reed
5387b8a806 Stylize API up to date
Fix spaces from r69755

Minor update to RELEASE-NOTES per r69753
2010-07-23 07:33:40 +00:00
Tim Starling
b2dc451c82 Rewrote r69339 etc. to clean up API cache header handling.
* Introduced a "cache mode" concept to simplify the header generation code, and to avoid odd results when conflicting cache header requests are received from submodules, or at least to formalise the handling of such cases.
* Made the cache mode private by default, so that code written in ignorance of caching tends to be safe. If different query modules are used in a single request, private caching is preferred over public caching.
* Removed the "must-revalidate" option from all CC headers, this is really specific to page views with a hacked squid in front, I don't think it's applicable here.
* Made the watchlist module private. This is really the definition of private data. There's nothing in the HTTP spec that says the URL for a CC:public request is private and can't be leaked. CC:private provides protection against unknown proxy behaviour.
* In ApiQueryAllmessages: avoid calling $wgLang->getCode() to check if it's necessary to make a new $wgLang when lang= is specified, since this is the only thing that unstubs $wgUser.
* Removed "FIXME: should this check $user instead of $wgUser?" Answer is no.
2010-07-23 07:17:56 +00:00
Roan Kattouw
70824ccccc API: Make output containing private or user-specific data uncacheable for logged-in users by setting Vary: Cookie or Cache-Control: private, whichever is appropriate. Fixes instances in core and WMF-deployed extensions only. Without this change, the output of requests like ?action=query&list=recentchanges&rcprop=patrolled&smaxage=3600 would be cached in Squid and viewable for anyone using the same URL, even if they don't have patrol rights. Other, more serious exploits are also possible. Also avoid using $wgUser in one place, kill some unused global $wgUser; instances and tweak a comment. 2010-07-14 19:00:54 +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
Roan Kattouw
a973430991 Followup to r67554: move getAcceptLang() to WebRequest for general use, per CR. 2010-06-18 18:00:54 +00:00
Sam Reed
18227749a6 Minor followup to r68156, add "user" as implicit group
Refactor out and reuse in ApiQueryUserInfo

Add couple more braces to SpecialUserrights
2010-06-17 08:00:42 +00:00
Roan Kattouw
44c199ea0c API: Add Accept-Language echoer, useful for JS that wants to grab this (not available in JS through conventional means, can't embed it in the page because of Squid caching). Stuck this in meta=userinfo because it doesn't really fit anywhere and userinfo is the only module that's slightly, tangentially related. 2010-06-07 18:53:30 +00:00
Matthew Britton
2ecd319b3b API: document uiprop=email parameter 2010-05-16 13:23:56 +00:00
Jack Phoenix
7ced9bc569 API: fix copyright symbol, coding style cleanup, more braces 2010-02-26 13:18:56 +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
Alexandre Emsenhuber
270950f611 * (bug 21441) meta=userinfo&uiprop=options no longer returns default options for logged-in users under certain circumstances
User::$mOptions is no now only set when calling User::loadOptions() and thus remain null on cache hit and thus the api displays default user settings
2009-12-13 20:55:09 +00:00
Chad Horohoe
a4e5e935b6 Mass convert NULL -> null. Left strings and comments alone, obviously. 2009-12-11 21:07:27 +00:00
Roan Kattouw
3d33524baa API: Added uiprop=changeablegroups to meta=userinfo 2009-03-26 13:10:13 +00:00
Roan Kattouw
88f35cdf6e API: Some cleanup
* Aggressively intval() numeric things; addresses the concerns raised on bug 11633
* Use ApiQueryBase::addTitleInfo() everywhere
* Remove a drug-induced-looking line from ApiQueryWatchlist.php
2009-02-27 16:03:01 +00:00
Roan Kattouw
decfd47c11 API: (bug 17626) Added uiprop=email to meta=userinfo 2009-02-23 13:34:29 +00:00
Roan Kattouw
a6e101025d Fix up r43673: reindex the rights array after removing duplicates 2008-11-20 15:15:00 +00:00
Roan Kattouw
c3be8a3034 API: (bug 16398) meta=userinfo&uiprop=rights lists a right twice if it's granted to two groups the user is in 2008-11-20 14:46:10 +00:00
Roan Kattouw
7aff9997f2 API: (bug 12760) meta=userinfo&uiprop=ratelimits doesn't list group-specific rate limits 2008-11-18 16:05:24 +00:00
Roan Kattouw
4c7206a478 Followup to r41257: don't give out a token when we're in JSON callback mode 2008-09-25 15:27:04 +00:00
Roan Kattouw
09ccd3adbe API: Added uiprop=preferencestoken to meta=userinfo, to retrieve the token for chaning one's preferences through Special:Preferences (and possibly through a future API module if and when the preferences system doesn't suck so much anymore). 2008-09-25 15:20:37 +00:00
Brion Vibber
a4ffac4063 Revert r35178 and normalize User's getID() and setID() methods to prettier getId() and setId()
This doesn't accomplish anything, of course, but if you're going to run around changing them, at least make em prettier eh? :)
2008-05-22 16:39:43 +00:00
Aaron Schulz
ae54dbbb3d *The function is User::getID() not getId() 2008-05-22 14:57:07 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Brion Vibber
09edeb70bb Reverting r35060 -- can't reproduce the reported problem so far, but if it exists this should be moved upstream so User::getGroups() and User::getRights() return consistent values themselves 2008-05-19 22:15:17 +00:00
Bryan Tong Minh
fdaf603064 Force indices of groups and rights array to be in order so that the JSON formatter recognizes it as a list instead of a dict in case for some reason rights or groups are removed somewhere in between (as done for sysops on testwiki). 2008-05-19 21:43:52 +00:00