42
edits
(bring in changes from sandbox) |
DarkShadow (talk | contribs) m (1 revision imported) |
||
Line 14: | Line 14: | ||
pagename = title.prefixedText | pagename = title.prefixedText | ||
if action == 'autoreview' then | if action == 'autoreview' then | ||
local level = mw. | local level = mw.getCurrentFrame():callParserFunction('PENDINGCHANGELEVEL', pagename) | ||
if level == 'review' then | if level == 'review' then | ||
return 'reviewer' | return 'reviewer' | ||
Line 23: | Line 22: | ||
return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review | return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review | ||
end | end | ||
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload | elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then | ||
error( 'First parameter must be one of edit, move, create, upload | error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 ) | ||
end | end | ||
if title.namespace == 8 then -- MediaWiki namespace | if title.namespace == 8 then -- MediaWiki namespace | ||
return 'sysop' | |||
elseif title.namespace == 2 and title.isSubpage and ( title.contentModel == 'javascript' or title.contentModel == 'css' ) then -- user JS or CSS page | |||
elseif title.namespace == 2 and title.isSubpage | |||
return 'sysop' | return 'sysop' | ||
end | end | ||
Line 52: | Line 40: | ||
local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move. | local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move. | ||
if blacklistentry and not blacklistentry.params.autoconfirmed then | if blacklistentry and not blacklistentry.params.autoconfirmed then | ||
return ' | return 'accountcreator' | ||
elseif title.namespace == 6 then | elseif title.namespace == 6 then | ||
return 'filemover' | return 'filemover' | ||
else | else | ||
return 'autoconfirmed' | return 'autoconfirmed' | ||
Line 63: | Line 49: | ||
local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename) | local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename) | ||
if blacklistentry then | if blacklistentry then | ||
return blacklistentry.params.autoconfirmed and 'autoconfirmed' or 'accountcreator' | |||
elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason | elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason | ||
return 'autoconfirmed' | return 'autoconfirmed' |