Commit graph

170 commits

Author SHA1 Message Date
Sam Reed
1d5b18a1a2 Revert r85776, r85782 pending better solution 2011-04-12 20:27:26 +00:00
Sam Reed
89a136bb46 Followup r85776, per Aaron, add documentation showing reason why explicit creation of a new LB was added 2011-04-11 12:48:59 +00:00
Sam Reed
0966401501 * (bug 28485) Block::purgeExpired Database returned error "1205: Lock wait timeout exceeded;"
Commit changes per Tims suggestion on the ubg
2011-04-11 00:29:42 +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
12a29249ae Try to untangle the autoblock time logic, which made very little sense and led to very old indefinite blocks triggering autoblocks with ipb_expiry < ipb_timestamp. 2011-03-23 00:10:46 +00:00
Happy-melon
40a926ab2c (hopefully) last bit of heavy lifting in Block.php: now that we've internalised most of the variables, untangle their twisted connections to the database layer and remove various now-unused protected methods and variables. 2011-03-22 17:18:15 +00:00
Aaron Schulz
f6e0bc9324 Fixed daft error in r84523 so "angry" autoblocks work again 2011-03-22 11:51:09 +00:00
Happy-melon
a9016c40ff Don't try and load a block with no target; we're not going to find it :D 2011-03-22 11:45:18 +00:00
Aaron Schulz
bc6ec5e2ff Relate block log entries to block table rows (useful for bug 25763) 2011-03-22 11:22:15 +00:00
Happy-melon
271062e07e Follow-up r84475: what ever posessed me to get rid of this? 2011-03-21 23:27:08 +00:00
Happy-melon
cf08b61b1b Follow-up r84475: fixing the warning is easy enough... :D Also some random tweaks to Database.php documentation. 2011-03-21 23:03:11 +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
b61f104042 Follow-up r84358 CR: rename 'editusertalk' to 'editownusertalk', private --> protected, and run stylize.php over Block.php 2011-03-20 17:43:17 +00:00
Happy-melon
7eac649e6d * Implement an extensible Block::prevents( <action> ) function to replace the plethora of direct member variable accesses This pushes the historic *disable*-createaccount-vs-*allow* usertalk-edit wierdness down to the database layer
* Implement accessors for isHardblock() and getRangeStart()/getRangeEnd() in the same fashion.
* Make the corresponding variables private, removing external accessors.  This required updating AbuseFilter with non-B/C code, so I also implemented the rest of the changes I've made to the blocking backend in that extension.
* Move the "get an IP range which encompasses the given IP/range" logic to Block.php; will be needed later... :D
2011-03-19 23:47:08 +00:00
Happy-melon
d1223c41bb Mark various internal methods as protected, which have no external calls in core or extensions. 2011-03-19 17:44:01 +00:00
Happy-melon
408181b29e Follow-up r84336: break some long lines 2011-03-19 17:36:10 +00:00
Happy-melon
f1b1aafa1d Block::forUpdate() is never called, and doesn't really make much sense in this context anyway; remove it and simplify. 2011-03-19 17:32:59 +00:00
Happy-melon
04e5a7daa3 Clarify the behaviour of Block::parseTarget(), and that TYPE_AUTO and TYPE_ID are broadly the same. 2011-03-19 16:50:21 +00:00
Happy-melon
3e89cb5506 Remove some insanely ancient (~r4797) unused globals and variables, and make private variables actually private (no external calls to worry about) 2011-03-19 16:41:14 +00:00
Happy-melon
99f39a4779 Move Block::normaliseRange() to IP.php, then reduce it to 4 lines by using the existing functionality in that class. 2011-03-18 23:28:23 +00:00
Happy-melon
21fcf991d0 Follow-ups to r84258 2011-03-18 22:28:39 +00:00
Happy-melon
91e7b5a93c More cleanup in Block.php. Push Block::encodeExpiry() and Block::decodeExpiry() deeper into the callstack, to DatabaseBase for encode and Language for decode. The vast majority of callers of these functions are not handling block expiries, but expiries generally, particularly page protections. 2011-03-18 19:15:56 +00:00
Happy-melon
ad0e525ede First forays into the swamp of the Block.php backend:
* Move Block::parseExpiryInput() to the frontend SpecialBlock::parseExpiryInput()
* consolidate the several implementations of the MediaWiki:Ipblockoptions parsing into SpecialBlock::getSuggestedDurations()
2011-03-18 16:35:22 +00:00
Happy-melon
0a8a3b452c Further massive rewrite of the blocking frontend: spin out unblocking into a new SpecialUnblock.php. This leaves IPBlockList as, astonishingly enough, a list of blocks... :D 2011-03-13 21:33:52 +00:00
Happy-melon
995d7bb5ea Follow-up r83827: a Block object will never be internally of TYPE_ID. 2011-03-13 15:44:49 +00:00
Happy-melon
bb6644de69 Follow-up r83825: fix Block::parseTarget to recognise autoblocks separately, and change Block::getRedactedName() to run the string through a system message for localisation 2011-03-13 15:14:33 +00:00
Happy-melon
f64f960d9a Some refactoring in Block.php and SpecialBlock.php: move backend stuff into Block.php, and expand the parseTargetAndType() functions to recognise blocks referenced by their block id. 2011-03-13 14:47:34 +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
Chad Horohoe
b61756cdea Followup r73348, r70608: move 'infinity' stuff to DB classes 2011-01-05 13:43:13 +00:00
Brian Wolff
2b1a4c92d4 (Bug 26425) Due to r71751, wfTimestamp stopped accepting '' to mean get
current timestamp. This caused Block::__construct to put all sort of 
messages in the debug log about invalid timestamp. So change Block to use
timestamp of 0 instead of '' if unspecified.
2010-12-26 04:38:41 +00:00
Aaron Schulz
8648b3cdca Fixed r76560: one more caller of now-private toUnsigned6 2010-12-08 22:18:43 +00:00
Roan Kattouw
11c67c2d6d Fix indentation in Block::infinity() 2010-11-25 15:12:04 +00:00
Sam Reed
a2589ff8c6 Assignment in loop conditions suck
while ( $row = $dbw->fetchObject( $res ) ) { to foreach ( $res as $row ) in includes

Add some braces
2010-10-13 23:11:40 +00:00
Chad Horohoe
7d3bd14822 Followup r70608, don't use master connection just for type check, and use getType() instead of instanceof 2010-09-19 23:25:57 +00:00
Ryan Bies
070122e8b9 DatabaseMssql class and related changes 2010-08-06 23:44:00 +00:00
Alexandre Emsenhuber
4b507edd85 removed PHP4-ism 2010-07-11 18:13:23 +00:00
Alexandre Emsenhuber
fa537d2d3f Fixed some doxygen warnings 2010-06-15 20:09:19 +00:00
Siebrand Mazeland
d279df340e Ran stylize.php, removed trailing whitespace, updated indentation and code formatting. 2010-05-30 14:48:30 +00:00
Platonides
2eea87df8a Stylize. 2010-04-17 21:16:06 +00:00
Platonides
839001c7cc Add yet another parameter for Block construction, so this doesn't show runJobs.php blocking anyone when run from the job queue :)
Follow up r65184.
2010-04-17 21:06:21 +00:00
Platonides
38e64983a2 Follow up r64982. Autoblocks aren't automatically set just by storing ipb_enable_autoblock, we need to look for them.
So do this properly and use Block class to insert the block.
2010-04-17 20:59:05 +00:00
Max Semenik
5d543aeae8 Fix bug that prevented non-hidden users from appearing on Special:BlockList on SQLite 2010-03-12 19:18:14 +00:00
Alexandre Emsenhuber
a5ebe1f736 * (bugs 22665 and 22667) User '0' can now be unblocked and have its block settings changed 2010-02-27 16:15:41 +00:00
Siebrand Mazeland
f8b1c4cfb7 Random indentation and code formatting updates. No functional changes. 2010-02-14 22:07:30 +00:00
Jure Kajzer
785ad24aa7 Changed sequence names to a standard <table>_<field>_seq form.
Updated all nextSequenceValue calls with new sequence names.
OverlordQ stated he'll handle changes to Postgres scripts.
Need someone to change DB2 scripts.
2009-10-28 16:17:16 +00:00
Max Semenik
ae57ab1eec (bug 20275) Fixed LIKE queries on SQLite backend
* All manually built LIKE queries in the core are replaced with a wrapper function Database::buildLike()
* This function automatically performs all escaping, so Database::escapeLike() is now almost never used
2009-10-21 19:53:03 +00:00
Jack Phoenix
092597b8e3 coding style tweaks 2009-10-19 11:15:51 +00:00
Siebrand Mazeland
5a40128656 (bug 17093) Separate date and time in Special:BlockList 2009-05-25 18:02:58 +00:00
Niklas Laxström
d3b61fea7c Escaping fixes 2009-05-22 09:35:48 +00:00