MediaWiki:Group-sysop.js

$(function ($) {	var link, reason, ips, ip, i;

// Opt-out if ( window.disableSysopJS ) { return; }

/**	 * Sensitive IP checker *	 * Blocking certain ranges is politically sensitive, and must be reported * to the Foundation Communications Committee. *	 * Maintainers: east718 */	if (mw.config.get('wgCanonicalNamespace') === 'Special' && mw.config.get('wgCanonicalSpecialPageName') === 'Block' && document.getElementById('mw-bi-target')) { ips = [ [/\b63\.162\.143\.21\b/, 'the US Department of Homeland Security'], [/\b82\.148\.9(6\.68|7\.69)\b/, 'Qatar'], [/\b128\.183\.103\.97\b/, 'NASA'], [/\b(((2|5)?6|7|[12]1|2(2|8|9)|3(0|3)|55)\.([01]?\d\d?|2(5[0-5]|[0-4]\d))|130\.22)(\.([01]?\d\d?|2(5[0-5]|[0-4]\d))){2}\b/, 'the US Department of Defense'], [/\b138\.16[23](\.([01]?\d\d?|2(5[0-5]|[0-4]\d))){2}\b/, 'the US Naval Telecommunications Station'], [/\b143\.2(2[89]|3[01])(\.([01]?\d\d?|2(5[0-5]|[0-4]\d))){2}\b/, 'the US House of Representatives'], [/\b149\.101(\.([01]?\d\d?|2(5[0-5]|[0-4]\d))){2}\b/, 'the US Department of Justice'], [/\b156\.33(\.([01]?\d\d?|2(5[0-5]|[0-4]\d))){2}\b/, 'the US Senate'], [/\b(162\.4[56]\.([01]?\d\d?|2(5[0-5]|[0-4]\d))|198\.81\.(128|129|1[3-8]\d|191))\.([01]?\d\d?|2(5[0-5]|[0-4]\d))\b/, 'the US Central Intelligence Agency'], [/\b192\.197\.(7[7-9]|8[0-6])\.([01]?\d\d?|2(5[0-5]|[0-4]\d))\b/, 'the Government of Canada'], [/\b(51(\.([01]?\d\d?|2(5[0-5]|[0-4]\d))){2}|194.60.\d[0-5]?)\.([01]?\d\d?|2(5[0-5]|[0-4]\d))\b/, 'the UK Parliament'], [/\b66\.230\.(19[2-9]|2[0-3]\d)\.([01]?\d\d?|2(5[0-5]|[0-4]\d))\b/, 'the Wikimedia secure gateway'] ];

ip = $('#mw-bi-target').val;

if (/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/.test(ip)) { for (i = 0; i < ips.length; i++) { if (ip.match(ips[i][0])) { mw.notify(						$( ' ' ) );				}			}		}	}

});