Jump to content

Module:Sensitive IP addresses/blocktext

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 06:34, 8 October 2018 (create structure for a module to generate text at Special:Block). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
-- This module creates a warning about sensitive IP addresses that is intended
-- to be placed in [[Special:Block]] via the [[Mediawiki:Blockiptext]] message.

local querySensitiveIPs = require('Module:Sensitive IP addresses').query
local m_ip = require('Module:IP')
local IPAddress = m_ip.IPAddress
local Subnet = m_ip.Subnet

local function normalizeIPOrRange(ipOrRange)
end

local function parsePageName(page)
end

local function fetchSensitivityData(ipOrRange)
	return querySensitiveIPs{test = {ipOrRange}}
end

local function generateMessage(sensitivityData)
end

local p = {}

function p._main(args, title)
	if not title then
		title = mw.title.getCurrentTitle()
	end
	local ipOrRange = parsePageName(title.prefixedText)
	if not ipOrRange then
		return nil
	end
	return generateMessage(fetchSensitivityData(ipOrRange))
end

function p.main(frame)
	local args = require('Module:Arguments').getArgs(frame)
	return p._main(args)
end

function p._exportFunctions()
	return {
	}
end

return p