Open main menu

Changes

Module:Protection banner

550 bytes added, 23:46, 26 June 2014
add expiry category code
local configObj = self._configObj
local protectionStatusObj = self._protectionStatusObj
local reasonsWithoutExpiryCheck = configObj:getConfigTable('reasonsWithoutExpiryCheck')
local expiryCheckActions = configObj:getConfigTable('expiryCheckActions')
local expiry = protectionStatusObj:getExpiry()
local action = protectionStatusObj:getAction()
local reason = protectionStatusObj:getReason()
if not expiry
and expiryCheckActions[action]
and reason -- the old {{pp-protected}} didn't check for expiry
and not reasonsWithoutExpiryCheck[reason]
then
local cat = configObj:getMessage('tracking-category-expiry')
Category.setName(self, cat)
return Category.export(self)
end
end
local level = protectionStatusObj:getLevel()
if level == '*' or action == 'move' and level == 'autoconfirmed' or type(expiry) == 'number' and expiry < os.time() then
Category.setName(self, configObj:getMessage('tracking-category-incorrect'))
return Category.export(self)
Anonymous user