Module:UserLinks/extra: Difference between revisions

Content deleted Content added
Have linkFunctions.http produce valid links for IPv6
add fa lr and mr
 
(4 intermediate revisions by 3 users not shown)
Line 31:
'COIBot'
)
end
 
function linkFunctions.fa(snippets)
-- Former admin label
return message('display-formeradmin')
end
 
Line 48 ⟶ 53:
-- To see if an IP is serving a web page
 
local host = snippets.username
if not string.host:match( host, '^%d+%.%d+%.%d+%.%d+$' ) then
if host:match('^[%x:]+$') then
-- It's not IPv4IPv6, use RFC 3986 IP-Literal syntax
host = '[' .. host .. ']'
end
else
-- It's neither IPv4 nor IPv6, return nothing
return ''
end
end
 
return makeUrlLink(
Line 60 ⟶ 70:
},
'http'
)
end
 
function linkFunctions.lr(snippets)
-- Local rights
return makeFullUrlLink(
snippets.interwiki,
-1,
'Log',
{page = 'User:' .. snippets.username},
message('display-localrights')
)
end
function linkFunctions.mr(snippets)
-- Meta user rights
return makeFullUrlLink(
'meta',
-1,
'Log',
{page = 'User:' .. snippets.username .. '@enwiki'},
message('display-metarights')
)
end
Line 83 ⟶ 115:
protocol = 'https',
host = 'www.robtex.com',
path = '/rblsip-lookup/' .. snippets.username .. '.html#dnsbl',
},
'RBLs'
Line 93 ⟶ 125:
return makeUrlLink(
{
protocol = 'httphttps',
host = 'www.dnswatch.info',
path = '/dns/dnslookup',
Line 120 ⟶ 152:
return makeUrlLink(
{
protocol = 'httphttps',
host = 'www.stopforumspam.com',
path = '/search/' .. snippets.username,