Content deleted Content added
Updating published sources: PERTableUpdater: * Add a comment to document the structure of the @data array. |
Updating published sources: PERTableUpdater: * Adjust coloring for cascading protection. Even though cascading semi-protection isn't possible, we'd want it red on CAT:ESP if it were. * Consider the cascade-protected page itself as cascading too * I... |
||
Line 128:
# 0: unprotected
# 1: semi-protected
# 2: semi-protected via title blacklist
# 3: User CSS/JS page
# 4: fully protected
# 5: fully protected via title blacklist, or cascading protection
# 6: MediaWiki-namespace page
my @data=(
Line 204:
# Protection scoring "bitmap":
#
#
#
#
#
#
# 0x02 = Title blacklist protection
# Highest score by int value "wins".
my $protscore=0;
Line 217:
if($p->{'ns'}==8){
$pd->{'prottype'}='MediaWiki page';
$protscore=
} elsif($p->{'ns'}==2 && $t=~m!/.*\.js$!){
$pd->{'prottype'}='User JS page';
Line 241:
next unless $pp->{'type'} eq 'edit';
my $sc=0;
$sc|=
$sc|=
$sc|=exists($pp->{'source'})?0x80:0x08;
$sc|=0x80 if exists($pp->{'cascade'});
next if $sc<$protscore;
if(exists($pp->{'source'})){
Line 251 ⟶ 253:
$pd->{'prottype'}='Fully protected' if $pp->{'level'} eq 'sysop';
$pd->{'prottype'}='Semiprotected' if $pp->{'level'} eq 'autoconfirmed';
$pd->{'prottype'}.=' with cascading' if exists($pp->{'cascade'});
}
$pd->{'prottype'}.=strftime(', expires %F at %T UTC', gmtime ISO2timestamp($pp->{'expiry'})) if $pp->{'expiry'} ne 'infinity';
Line 260 ⟶ 263:
if($protscore & 0x10){
$pd->{'color'}=$colors->[1];
$pd->{'color'}=$colors->[2] if($protscore &
}
$pd->{'color'}=$colors->[3] if($protscore & 0x20);
if($protscore & 0x40){
$pd->{'color'}=$colors->[4];
$pd->{'color'}=$colors->[5] if($protscore &
}
$pd->{'color'}=$colors->[
$pd->{'color'}=$colors->[6] if($protscore & 0x100);
$pd->{'color'}='green' if($pd->{'color'} eq 'clear' && grep($p->{'ns'}==$_, @$greenns));
|