Commit graph

118 commits

Author SHA1 Message Date
Roan Kattouw
10c679488c Revert live hack from r36493, because it has no effect whatsoever.
$params['action'] cannot be an invalid action, because the $params array is filled by ApiBase::extractRequestParams() which checks whether the parameters are valid and throws an error message (ironically implemented with a UsageException) if they're not.
2008-06-20 10:51:17 +00:00
Brion Vibber
cc722a0b4c Apply live hack -- exception for invalid actions (as opposed to....?) 2008-06-19 23:48:09 +00:00
Roan Kattouw
a1d340cb43 Add maxage too 2008-06-16 20:06:23 +00:00
Roan Kattouw
044ad0c0ce (bug 14402) Added smaxage parameter to api.php 2008-06-16 19:49:43 +00:00
Bryan Tong Minh
1a3664ee7e API: Add action=emailuser 2008-06-01 17:58:27 +00:00
Roan Kattouw
379eb2210b * Added 'writeapi' right that controls access to the write API. Users who don't have this right won't be able to use the write API modules even if $wgEnableWriteAPI = true; and they have the other rights required
* Checking for 'writeapi' in ApiMain::requestWriteMode() and tweaking the noapiwrite error message a bit
* Granting this right to *, user and bot by default.

For extra clarity: to e.g. move pages through the API, a user needs to have the 'move' right AND the 'writeapi' right AND $wgEnableWriteAPI = true;
2008-05-27 15:43: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
Roan Kattouw
72b793a695 Remove deprecated ApiMain::scheduleCommit() 2008-05-18 20:15:56 +00:00
Tim Starling
a4eaa89625 * Fix unlogged automatic user creation: run wfLBFactory()->shutdown() unconditionally in api.php. If you want to optimise it, do it in the database backend, since there's no way for the MW core to indicate to the web API that a write query has been performed. The previous code was also wrong in that it didn't commit transactions on foreign connections.
* Fixed debugging code left in (mustBePosted disabled).
2008-05-17 04:26:26 +00:00
Roan Kattouw
af9727e637 Re-applying r34440 (documenting ApiQueryBase) 2008-05-10 09:29:34 +00:00
Brion Vibber
4bc02c88ca Revert to r34430 in order to revert r34431 which is breaking the site (unindexed filesorts) 2008-05-09 18:00:15 +00:00
Roan Kattouw
2fe7734396 Documenting some API stuff 2008-05-08 15:46:06 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Roan Kattouw
68bbfc12c0 Committing patch for bug 10931, which also fixes bug 13651. For a detailed explanation of what this commit does, see bug 10931 comment #24 2008-04-11 15:20:45 +00:00
Bryan Tong Minh
06d1b8087d (bug 11673) Return error 'unknown_action' in specified format 2008-04-05 19:32:21 +00:00
Tim Starling
fbfb509df5 * Introduced LBFactory -- an abstract class for configuring database load balancers and connecting to foreign DBs.
* Wrote two concrete implementations. LBFactory_Simple is for general installations. LBFactory_Multi will replace the runtime configuration used on Wikimedia and allow load-balanced connections to any DB. 
* Ported Special:Userrights, CentralAuth and OAI audit to the LBFactory system. 
* Added ForeignDBViaLBRepo, a file repository which uses LBFactory.
* Removed $wgLoadBalancer and $wgAlternateMaster
* Improved the query group concept to allow failover and lag control
* Improved getReaderIndex(), it will now try all servers before waiting, instead of waiting after each.
* Removed the $fail parameter to getConnection(), obsolete. 
* Removed the useless force() function. 
* Abstracted the replication position interface to allow for future non-MySQL support.
* Rearranged Database.php. Added a few debugging features. 
* Removed ancient benet-specific hack from waitForSlave.php
2008-03-30 09:48:15 +00:00
Roan Kattouw
a1e4f7a51c Removing ApiChangeRights module 2008-03-27 21:13:03 +00:00
Yuri Astrakhan
ae188d8682 Updated credits per discussion with Brion 2008-03-20 06:54:24 +00:00
Roan Kattouw
550aa15685 API: Adding more detail in credits 2008-03-17 20:13:22 +00:00
Roan Kattouw
b558d012f2 API: Updating action=help credits to give Yuri and Vasiliev due credit 2008-03-17 18:16:51 +00:00
Roan Kattouw
e0aae6a658 API: Adding action=edit module 2008-03-03 18:08:40 +00:00
Brion Vibber
46619295eb Safety fixes for API:
* drop user credentials for JSON callback output
* anticipating future changes, don't report anon edit tokens in JSON callback output
2008-03-03 05:45:37 +00:00
Roan Kattouw
7de8bc26be API: Updating credits to reflect my having replaced Yuri as de facto API lead developer, and referring to mediawiki-api and Bugzilla for questions/suggestions 2008-02-07 15:58:53 +00:00
Roan Kattouw
19358606a1 API: Changing all modules' getParamDescription(), getAllowedParams() and getDescription() methods to public. ApiParamInfo needs them, and some versions of PHP threw fatal errors because they were protected. Oddly, other versions didn't (maybe because the caller and the callee have a common ancestor?) 2008-01-28 19:05:26 +00:00
Roan Kattouw
9c55586e57 Tweaking r30119: changing txt and dbg's MIME type to text and adding txtfm and dbgfm with HTML-escaped stuff. 2008-01-24 13:16:34 +00:00
Roan Kattouw
d2cb8c025e No need to revert r30078: HTML-formatting the data is enough. Attacks like api.php?action=paraminfo&modules=%3Cscript%3Ealert('Owned');%3C/script%3E&format=txt don't work anymore now. 2008-01-24 13:12:03 +00:00
Brion Vibber
c0801b22f0 Revert r30078 -- formats "txt" and "dbg" dump raw unfiltered text contents into HTML output. XSS vector. 2008-01-23 23:06:10 +00:00
Roan Kattouw
262afb4b62 API: Adding txt and dbg formats, imported from query.php 2008-01-23 19:51:21 +00:00
Roan Kattouw
8a0e46d97c API:
* Fixing buggy class instantiation in ApiParamInfo
* Adding getModules() method to ApiMain and ApiQuery
2008-01-23 18:40:40 +00:00
Roan Kattouw
abaf9995ba (bug 12718) Added action=paraminfo module that provides information about API modules and their parameters 2008-01-22 21:22:04 +00:00
Roan Kattouw
491cc4a320 API: Making a bunch of state-changing modules require POST requests. 2008-01-18 20:43:59 +00:00
Roan Kattouw
bb7f8624d1 API:
* Removing action=render module (which was deprecated) in favor of action=parse
* Added prop parameter to action=parse so certain parts of the output can be left out
* action=parse&prop=text behaves pretty much exactly like action=render used to
2008-01-15 21:33:08 +00:00
Victor Vasiliev
4cc099d5d1 API: add action=logout 2008-01-08 18:10:58 +00:00
Roan Kattouw
ed0a58e527 Re-adding ApiChangeRights, but commenting out its entries in ApiMain and AutoLoader. This way the module will be inaccessible for clients, but still present in SVN to be viewed and modified. 2008-01-04 22:33:22 +00:00
Brion Vibber
c04db5771d Revert r29261, r29271 for now -- some weird mixing up of functions and seemingly random array structures, and it puts back a restricted API module I'd rather not see there for now. 2008-01-04 17:35:09 +00:00
Roan Kattouw
5395945052 * Unbroke Special:Userrights for wikis without pretty URLs
** This probably shouldn't be hard-coded the way I did it
* UserrightsPage::saveUserGroups() now takes $removegroup and $addgroup parameters by reference. Parameters are changed to reflect what was actually added and removed.
* Re-adding ApiChangeRights module, which now handles permission denied errors more gracefully
2008-01-04 11:50:22 +00:00
Brion Vibber
49e10ba5eb Remove ApiChangeRights. Duplicates code, doesn't handle current permissions model properly. 2008-01-03 23:39:21 +00:00
Roan Kattouw
fd5a884b77 API: A cleaner implementation of r28057: this one also hides disabled modules from the list of possible actions on top of the help screen. 2007-12-03 15:52:27 +00:00
Victor Vasiliev
3a24c169ea API:
* Hide edit modules from help if $wgEnableWriteAPI is disabled
* Fix help formatting on UsageException
2007-12-02 15:04:53 +00:00
Roan Kattouw
6e61566e3e Changing error code to prevent confusion with wfReadOnly() == true 2007-12-02 14:44:35 +00:00
Roan Kattouw
730bad3fb1 APIEDIT BRANCH MERGE: Adding apiedit modules: action={block,changerights,delete,move,protect,rollback,unblock,undelete} and list={blocks,deletedrevs}. $wgEnableWriteAPI must be explicitly set to enable these modules. 2007-12-02 14:24:07 +00:00
Victor Vasiliev
32ccdc3d5a * Use *bold* and $italics$ highlighting only in API help. It completely breaks formatting on meta=allmessages and no one needs it 2007-12-01 17:37:08 +00:00
Victor Vasiliev
17cf492e6b * Introduce action=parse to API. It deprecates action=render which will be removed once (perhaps before 1.12 release). New action returns full parser output instead of returning just rendering text 2007-12-01 13:37:02 +00:00
Tim Starling
65b4736e66 Trivial bug in new apihighlimit feature 2007-11-30 14:41:30 +00:00
Roan Kattouw
073bc45c2b Adding apihighlimits permission. Users with this permission can request 10 times as many rows in API requests. Enabled by default for sysops and bots. 2007-11-29 14:51:58 +00:00
Roan Kattouw
4895ce631f Revert part of Brion's 27627: please don't throw away the child (maxlag) with the bathwater (format=raw) 2007-11-19 15:57:58 +00:00
Brion Vibber
b61adceeb9 Revert r27581, 27598, 27626
format=raw is an HTML injection machine like action=raw but without any safeguards; it's trivial to create JavaScript exploits which hit at least Internet Explorer.
There's no reason to add a whole new danger point here when you've got machine-readable structure already... please do not add this raw formatter back.
2007-11-19 15:32:06 +00:00
Victor Vasiliev
d7908b82e0 * Use ApiBase::dieDebug() to render maxlag error properly
* Allow modules to ignore maxlag attribute
2007-11-19 15:08:18 +00:00
Victor Vasiliev
96940993bd * (bug 11206) api.php should honor maxlag
* Add wfMaxlagError function
* Add MIME type override option for format=raw
2007-11-18 09:37:52 +00:00
Victor Vasiliev
60fc9cb245 API:
* Add format=raw
* Added raw output support to ApiExpandTemplates and ApiRender
2007-11-17 16:45:59 +00:00