Last modified: 2014-03-16 11:32:58 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T64701, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62701 - Add hook to make it possible to check other open proxy lists besides $wgProxyList
Add hook to make it possible to check other open proxy lists besides $wgProxy...
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
User blocking (Other open bugs)
1.23.0
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-15 21:42 UTC by Nathan Larson
Modified: 2014-03-16 11:32 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Nathan Larson 2014-03-15 21:42:35 UTC
I want to add a hook to make it possible to check other open proxy lists besides $wgProxyList. Specifically, the addProxies.php maintenance script creates a proxy table, populates it using the http://www.stopforumspam.com/downloads list, and then checks the user's IP address against it. That way, it's unnecessary to process the whole file each time a user edits; it suffices to check the database. See [[mw:Manual:AddProxies.php#Hack_User.php]].

The implementation I have thus far adds wfRunHooks( 'LocallyBlockedProxy', array( $ip, &$ret ) ); to User::isLocallyBlockedProxy().
Comment 1 Gerrit Notification Bot 2014-03-16 01:12:08 UTC
Change 118942 had a related patch set uploaded by leucosticte:
Add LocallyBlockedProxy hook

https://gerrit.wikimedia.org/r/118942
Comment 2 Kunal Mehta (Legoktm) 2014-03-16 02:08:46 UTC
Eh, can't you just use the userCan hook?

Also for SFS, you can use [[mw:Extension:StopForumSpam]] :)
Comment 3 Nathan Larson 2014-03-16 11:32:06 UTC
Darn, wish I'd known about that extension yesterday. Anyway, it looks like you're right about the userCan hook; this adaptation of [[mw:Extension:RudeProxyBlock]] works:

$wgHooks['userCan'][] = 'efBlockOpenProxies';
$wgRudeProxyBlockDelimiter = "\n";

function efBlockOpenProxies( &$title, &$user, $action, &$result ) {
	if ( $action == 'edit' ) {
		global $wgRudeProxyBlockDelimiter, $wgProxyList;
		$ip = $wgUser->getRequest()->getIP();
		$openProxies = explode( $wgRudeProxyBlockDelimiter, wfMsg( 'openproxylist' ) );
		if ( in_array( $ip, $openProxies ) ) {
			$wgProxyList[] = $ip;
		}
	}
	return true;
}
Comment 4 Gerrit Notification Bot 2014-03-16 11:32:58 UTC
Change 118942 abandoned by leucosticte:
Add LocallyBlockedProxy hook

Reason:
Unnecessary; the userCan hook will suffice

https://gerrit.wikimedia.org/r/118942

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links