Commit graph

63 commits

Author SHA1 Message Date
Antoine Musso
6a8e32e986 Single messages can be passed as strings to Api::dieUsageMsg()
Since r88045
2011-05-19 17:51:16 +00:00
Paul Copperman
f7e6dfb4a3 Various fixes for PHPUnit tests:
* Block.php: Set mExpiry to the value we store in the database, so that Block::equals() returns true. Fixes BlockTest::testInitializerFunctionsReturnCorrectBlock.
* In Title::checkUserBlock(): Convert message parameters to plain strings to make strict comparisons work. Fixes TitlePermissionTest::testUserBlock().
* ApiBlock.php: Follow-Up r85166, add 'Confirm' parameter to data array. Fixes ApiBlockTest::testMakeNormalBlock().
* ApiQueryTest.php: Use $wgMetaNamespace instead of $wgSitename	to account for customizations.
* RandomImageGenerator.php: Use default value for constructor param to prevent fatals.
* ApiTestCaseUpload.php: 
** Fix undefined variable $fileName.
** Remove stray ini_set statements, they don't belong there. Especially ini_set( 'error_reporting', 1 ) will effectively disable all reporting, which makes errors hard to track.
* ArticleTablesTest.php: Put testbug14404() in group Broken, as the fix for the bug has been reverted in r83868.
2011-04-07 14:54:38 +00:00
Platonides
b37e81b76b Use class name Html in canonical form.
Removed unused globals $wgHooks, $wgBlockAllowsUTEdit, $wgUser, $wgOut
$wgUser was already set global at function beginning.
Moved global out of switch
2011-03-24 21:35:14 +00:00
Happy-melon
6dbcdc1be0 Blame hashar for this giant commit; he teased me for making so many smaller ones earlier... :D
* Internalise $mAddress/$mUser, $mBy/$mByName, $mEnableAutoblock, $mId as getTarget(), getBlockers(), isAutoblocking(), getId().  
* This required editing AbuseFilter and CheckUser backwards-incompatibly, so push the rest of the changes out to those extensions.
* Attack the evil 14-parameter constructor and gratuitously-confusing newFromDB( $notVeryImportantParameter, $moreImportantParameter)
* Reimplement the hack for bug 13611 in a slightly less fragile fashion; could still do with further cleanup, but then again the login frontend is its own can of worms... :S
* Remove transitionary getTargetAndType() and newFromTargetAndType() methods
* Some optimisation in parseTarget()
* Fix the broken phpunit test mentioned in r84251
2011-03-21 19:12:41 +00:00
Happy-melon
21fcf991d0 Follow-ups to r84258 2011-03-18 22:28:39 +00:00
Happy-melon
04aad77ea1 Follow-up r83825: fix fatal in API 2011-03-13 17:02:50 +00:00
Happy-melon
7805997608 Divert a river through the Augean Stables that is SpecialBlockip.php.
* Move to SpecialBlock.php, and rename class appropriately
* Complete refactor
* Use HTMLForm in block form.  This changes most of the ids and field names on the form, but allows proper validation, nicer formatting, clears up several fixmes, and is generally Better(TM).
* Spin various parts out into static functions, several of which properly belong in the backend (but Block.php is a worse mess still)
* Invert some of the block options so that every checkbox makes the block more severe (so "check to disable email" is fine, but "check to allow usertalk edit" (default true) is inverted to "check to disable usertalk edit" (default false). 
* revert r40359 (move doMassUserBlock() to core).  No one seems to be using this function, which has nothing to do with the frontend UI in SpecialBlock (it might perhaps belong in Block.php); it is pretty bespoke for CheckUser, doesn't seem to have very much utility elsewhere.
2011-03-12 21:54:35 +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
27ca6b2fa8 Tweak comments, remove some unused stuff.
Explicit definitions, move a few minor bits around
2011-02-27 21:10:11 +00:00
X!
867c9402be -Add &watchuser option to ApiBlock
-Write tests for ApiBlock
2011-01-02 19:58:27 +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
Roan Kattouw
17487e40ba Replace my old e-mail address with my new one in API comments. A bit outdated (dropped the old one in September '08) 2010-12-22 20:48:10 +00:00
Bryan Tong Minh
b98f2a5a71 (bug 25174) Add equal sign to boolean parameters in examples, so that the examples work immediately when posted 2010-11-23 22:05:27 +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
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
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
Roan Kattouw
7e9dcdd61b Fix coding style in r64230, r64256 2010-03-27 21:31:10 +00:00
Happy-melon
9990ba163e Per r64228 CR: make the check a static method in IPBlockForm to reduce duplication. 2010-03-27 15:05:56 +00:00
Happy-melon
d6fe6de7a8 Followup to r64228 - apply restrictions in API. 2010-03-26 23:02:10 +00:00
Jack Phoenix
ab5436aa56 ApiBlock.php: spacing & coding style tweaks, more braces, fixed copyright symbol 2010-02-21 12:32:46 +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
72df21ef49 Followup to bryans comment for r62328
Rename possibleErrors to getPossibleErrors
2010-02-11 21:53:57 +00:00
Sam Reed
aa973b9eb7 More of bug 18771 - List possible errors in action=paraminfo
Followup to comments of r62282
2010-02-11 21:34:35 +00:00
Sam Reed
ee60482546 Start implementation of bug 18771 - List possible errors in action=paraminfo
Base has empty array() returning method, ApiBlock has implementation of possibleErrors from code above (possibly not complete)

Can be finished incrementally, so serves as a review point for Roan
2010-02-11 01:13:45 +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
Chad Horohoe
354fbf19af Followup to r50744: Actually declare the method as public static, and use it in the API 2009-05-23 00:05:40 +00:00
Chad Horohoe
024e20a117 (bug 18549) Make Special:Blockip (and api action=block) respect $wgEnableUserEmail and $wgSysopEmailBans 2009-05-15 17:08:38 +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
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
e250759491 API: Make reblocking (introduced in r42843) possible through the API
* Add reblock parameter to action=block
* Tweak the description for allowusertalk for consistency
2008-11-18 15:21:04 +00:00
Roan Kattouw
40152f0aea API: Per IRC conversation with Splarka, add a few words about token availability from prop=info in the help text for action=block and action=unblock 2008-10-27 12:06:49 +00:00
Roan Kattouw
f6363295b4 API: Fixing r42583: true isn't even allowed as a default value 2008-10-26 10:47:13 +00:00
Roan Kattouw
e7c507a57a API: (bug 16115) API action=block dies with an exception when $wgBlockAllowsUTEdit is not a boolean (e.g. set to 1). While this shouldn't be done, of course, we can at least handle it more gracefully. 2008-10-25 22:22:22 +00:00
Tim Starling
f48c6070df Removed all instances of empty() where error suppression was not intended. Replaced with conversion to boolean, count() or empty string check as appropriate. Fixes a number of bugs due to incorrect conversion to boolean: suppressed edit summaries containing '0', ignored titles called '0', searches for '0' ignored, etc. 2008-10-25 14:04:43 +00:00
Matt Johnston
fdc01ccef2 (bug 8440) Add API support for new blocking flag, also fix defaults so anywhere else we use an IPBlockForm it'll use a more sensible default. 2008-10-02 09:34:29 +00:00
Roan Kattouw
244fa33d3d (bug 15486) API action=block ignores autoblock parameter 2008-09-05 15:05:57 +00:00
Bryan Tong Minh
6578dd7890 wfReadOnly now checked in ApiMain::requestWriteMode 2008-08-28 20:25:53 +00:00
Roan Kattouw
17b3fd4b63 API: Make action=block return an ISO 8601 timestamp rather than a UNIX timestamp 2008-05-27 10:18:28 +00:00
Bryan Tong Minh
e3275354a0 * Add wfRunHook calls where appropriate
* Fix handling of file redirects in ApiDelete
* Throw an error when a file is undeleted as this is not supported
2008-05-24 20:44:49 +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