Commit graph

97 commits

Author SHA1 Message Date
Aaron Schulz
e34a925007 * Move affectedRows count up
* Shouldn't need to pass db object here
* Some code style tweaks
2008-04-16 21:07:39 +00:00
Aaron Schulz
e599306830 * Allow for things that call addEntry() to pass in a DB object to make the action and logging be one transaction
* Improve logging transactions for block/delete
2008-04-15 23:34:45 +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
Victor Vasiliev
1bf9ad3bf0 * (bug 12999) introduce ipb_by_text colomn
N.B.: this is schema change (obviously)
2008-02-18 12:16:23 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Yuri Astrakhan
c17a9c53af API: enh 10260: Added page protection status query in prop=info. Applied modified patch from Roan Kattouw. 2007-06-18 02:00:23 +00:00
Daniel Cannon
7d3eb4accd (bug 7997) Added ability to Special:Blockip to block users from using Special:Emailuser. 2007-06-07 17:31:08 +00:00
Nick Jenkins
b4d37577b9 Removing or commenting out unused variables or globals, and adding declarations for two arrays. 2007-05-08 09:09:46 +00:00
Tim Starling
4e72474170 Fixed complete breakage of anon-only autoblocks, broken since r20436. 2007-04-20 04:17:15 +00:00
Tim Starling
a4dba3a1ba Reduce query/transaction count. 2007-03-31 17:23:10 +00:00
Aaron Schulz
17b53cedd4 *Fix isInRange(), remove cruft, add "ipv-6" prefix to toHex() and parseRange6(), actually show hidename option for blocks 2007-03-28 05:39:06 +00:00
Aaron Schulz
dd703702a1 *Defer to normaliseRange6() if needed 2007-03-14 17:41:12 +00:00
Aaron Schulz
133d8155fb *Add mHideName parameter for hiding usernames 2007-03-14 05:24:06 +00:00
Aaron Schulz
28772d7e2d *Get range blocks to consider "anononly" while I'm at it 2007-03-12 21:56:31 +00:00
Aaron Schulz
915f83d7b4 *IPv6 sanitizing, avoid use of native hex functions, enlarge ip box for blockip a bit 2007-03-12 21:37:46 +00:00
Aaron Schulz
0bbc7cbe34 *Automatic address expansion, remove redundant check 2007-03-12 19:31:30 +00:00
Aaron Schulz
c1de6176c9 * Add IPv6 support 2007-03-12 07:01:27 +00:00
Nick Jenkins
f88c771756 The war on redundant ampersand usage!
* Convert "$dbw =& wfGetDB( DB_MASTER );" --> "$dbw = wfGetDB( DB_MASTER );"
* convert "$skin =& $wgUser->getSkin();" --> "$skin = $wgUser->getSkin();"

For the time being have not changed the function definitions of wfGetDB() or User::getSkin() [i.e. they are still both return-by-ref], so as to ensure the interface does not change for extensions [some of which may still be trying to run on PHP4 environments]. However presumably at some point this can be changed too.

Also includes tiny tweak to newlines in parserTests - will show 1 rather than 2 newlines between the "Reading tests from" strings when in quiet mode.
2007-01-22 23:50:42 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Antoine Musso
b144fcb85d Rename constructors to __constructor 2007-01-20 13:34:31 +00:00
Andrew Garrett
b342a81da0 Well there was no problem in the first place. Nice work Werdna 2007-01-07 07:57:54 +00:00
Andrew Garrett
1e975a47b0 Okay brion, this patch actually /works/. Thanks to the miracles of testing, I can now be certain that it does something other than give a PHP warning. 2007-01-07 06:58:21 +00:00
Andrew Garrett
bafa087e99 Fix regression from r17927 that broke IP::isInRange (and hence the autoblock whitelist). 2006-12-08 10:30:50 +00:00
Nick Jenkins
07f59df83b $fname is not defined / null in these contexts, replacing with __METHOD__ 2006-11-29 12:45:47 +00:00
Nick Jenkins
ae8554c45b Completing code housekeeping stuff for rest of includes/ directory: removing unused local vars, removing unused globals, replacing extract() where simple to do, declaring output arrays before calling preg_match(), and so forth. 2006-11-29 11:43:58 +00:00
Nick Jenkins
a474761d9a Changing lines like this: "extract( $dbw->tableNames( 'page', 'archive' ) );" to be like this: "list ($page, $archive) = $dbw->tableNamesN( 'page', 'archive' );".
Three reasons for this:
1) It's better for analysis tools [which want explicit variable declaration]
2) It's easier for a human to read, as it's completely explicit where the variables came from [which is something you don't get with extract() ]
3) It makes it easier to find everywhere where a variable is used with search/grep [which you can't currently do with $tbl_page variables from things like: "extract($db->tableNames( 'page', 'revision'), EXTR_PREFIX_ALL, 'tbl');"].

Otherwise, from a functionality/efficiency perspective the two forms should be identical.

By doing this have been able run static analysis over the usages of these variables, thus eliminating 5 unneeded table names from calls, plus removing 3 unused calls entirely, and it just feels subjectively slightly nicer to me.
2006-11-27 08:36:57 +00:00
Tim Starling
4ce2ae3eb1 2006-11-27 02:43:36 +00:00
Tim Starling
a5b6bb3c26 oops 2006-11-25 17:32:41 +00:00
Tim Starling
a3a6ac13c3 * Added temporary special-case AOL proxy detection, they're automatically counted as trusted proxies for now.
* Removed wfRangeStartEnd() and wfIsAddressInRange() -- avoid proliferation of global functions.
2006-11-25 16:24:44 +00:00
Andrew Garrett
204e610f28 wfGetIp-> in checking autoblock whitelist in doAutoblock. Kudos to Simetrical for spotting the issue. 2006-11-23 05:10:29 +00:00
Aryeh Gregor
ea36e0918d Revert last three commits. I totally broke autoblock and didn't notice somehow. :| 2006-11-22 23:42:39 +00:00
Aryeh Gregor
a6931256ec More bugs! Why did I only spot these after commit >:| 2006-11-22 23:32:21 +00:00
Aryeh Gregor
4834a89438 Argh, syntax error 2006-11-22 23:27:10 +00:00
Aryeh Gregor
0c04d9885c * Moved Werdna's new IP functions to the IP class
* Handle bad input to new IP::isAddressInRange gracefully (return false)
* Block::doAutoblock always returns a bool now, as the docs say
* Split off Block::isWhitelistedIp from Block::doAutoblock
* Put AOL proxy IPs in whitelist, and also one from Singapore that was troublesome on enwiki (more should be added, probably?)
* Improve some docs
* Fix a bug: check if the passed IP is in the whitelist, not if the request IP is in the whitelist
2006-11-22 23:21:53 +00:00
Andrew Garrett
98a334ad27 * (bug 7883) Added autoblock whitelisting feature, using which specific ranges can be protected from autoblocking. These ranges are specified, in list format, in the autoblock_whitelist system message. 2006-11-22 11:51:49 +00:00
Rotem Liss
57c2844f7b Replacing the manual user and user talk links of the blocker in Special:Ipblocklist to Linker::userLink and Linker::userToolLinks; for that, added the function Block::getBy, to get the blocker user ID. 2006-11-21 18:26:55 +00:00
Tim Starling
2f12a58d93 * Introduced StringUtils.php, populated it with some generic string functions, both new and collected from various other files.
* Removed some backtracking regexes with an O(N^2) worst case, replaced with StringUtils::delimiterReplace(). There is a beneficial functional difference: /*/ is no longer considered to be a complete CSS comment.
* Changed the parser strip state from an array to an object. This should hopefully avoid the PHP bugs with array references. StripState uses the new ReplacementArray to do the replacements, thereby supporting FSS. 
* Removed DatabaseFunctions.php from the default startup sequence. Moved wfGetDB() to GlobalFunctions.php.
* Introduced the SiteStats class, with a collection of cached site stats accessor functions.
* Removed all global functions from Parser.php, they don't belong there.
* Made LanguageConverter use the new ReplacementArray class instead of managing its own FSS objects.
2006-11-21 09:53:45 +00:00
Andrew Garrett
a861fd02b6 Fix bug reported by Slowking_Man where retroactive autoblocks take effect even if the user being blocked was already blocked with autoblocks disabled. 2006-11-20 06:01:45 +00:00
Andrew Garrett
23021c7915 Make pretend feature from last commit actually exist 2006-11-13 06:44:37 +00:00
Andrew Garrett
8671e7cda8 * (bug 5149) When autoblocks are enabled, retroactively apply an autoblock to the most recently used IP of a user when they are blocked.
* Add an index on (rc_user_text,rc_timestamp) on the recentchanges table. This will make CheckUser.php and the new retroactive autoblock functionality faster.
2006-11-08 09:54:06 +00:00
Andrew Garrett
65957ef12c Various fixes related to the blocking change re: autoblocks. On inserting an IP block, the ipb_enable_autoblock field is now automagically blanked, because it doesn't make any sense for an IP block. Additionally, IP blocks without the ipb_enable_autoblock option no longer show up as "autoblock disabled" on Special:Ipblocklist. 2006-11-03 13:24:53 +00:00
Andrew Garrett
05f4492f06 Restore patch that was temporarily reverted in order to rectify an issue where the patch was applied without enacting required database changes 2006-11-01 21:57:18 +00:00
Andrew Garrett
5941189de0 Revert patch that was scapped into production without database changes 2006-11-01 21:36:03 +00:00
Tim Starling
329b012d2b Added block option "enable autoblocks". Patch by Werdna from bug 1294. 2006-11-01 07:13:31 +00:00
Brion Vibber
6966ffb95e * Fix regression which allowed some blocked users to create additional accounts 2006-07-17 06:28:06 +00:00
Tim Starling
0ade783ae2 Deferred loading of DateFormatter.php and IP.php. Standardised IP.php function naming style. 2006-07-14 17:02:49 +00:00
Antoine Musso
71fd92d760 Migrate IP related tools from ProxyTools.php to IP.php
and its own class of static functions
2006-07-12 18:33:21 +00:00
Tim Starling
1b1e8a498a Give manual blocks precedence over autoblocks 2006-07-11 05:30:35 +00:00
Tim Starling
23f2b6b5c5 Ignore ipb_anon_only and ipb_create_account for username blocks. 2006-07-10 08:38:22 +00:00
Tim Starling
1d9922db64 * Allow blocks on anonymous users only.
* Allow or disallow account creation from blocked IP addressess on a per-block basis.
* Prevent duplicate blocks. 
* Fixed the problem of expiry and unblocking erroneously affecting multiple blocks. 
* Fixed confusing lack of error message when a blocked user attempts to create an account. 
* Fixed inefficiency of Special:Ipblocklist in the presence of large numbers of blocks; added indexes and implemented an indexed pager.
2006-07-10 06:30:03 +00:00