Content deleted Content added
Updating published sources: PERTableUpdater: * Add User:AnomieBOT/PERTableHeader as a header to the pages. |
Updating published sources: PERTableUpdater: * Correctly indicate protection of user json pages. |
||
Line 167:
# 3: extended-confirmed protected
# 4: template protected
# 5: User
# 6:
# 7: fully protected
# 8: "fully" protected via title blacklist #
#
#
my @data=(
[[10,828],'PER','Wikipedia fully-protected edit requests','protected','editprotected','x-wp-editprotected',[qw/red red red red red clear red clear yellow yellow yellow red/]],
[[10,828],'TPER','Wikipedia template-protected edit requests','template-protected','edittemplateprotected','x-wp-edittemplateprotected',[qw/red red red red clear red red red yellow red red red/]],
[[10,828],'EPER','Wikipedia extended-confirmed-protected edit requests','extended-confirmed-protected','editextendedprotected','x-wp-editextendedprotected',[qw/red red red clear red red red red red red red red/]],
[[10,828],'SPER','Wikipedia semi-protected edit requests','semi-protected','editsemiprotected','x-wp-editsemiprotected',[qw/red clear yellow red red red red red red red red red/]],
[[],'IPER','Wikipedia interface-protected edit requests','interface-protected','editinterfaceprotected','x-wp-editinterfaceprotected',[qw/red red red red red red clear red red red red clear/]],
[[0],'EDITREQ','Requested edits','COI','requestedit','x-wp-requestedit',[qw/clear yellow yellow red red red red red red red red/]],
);
my $starttime=time;
Line 253 ⟶ 254:
# Protection scoring "bitmap":
#
#
#
#
#
#
#
#
#
#
# 0x02 = Title blacklist protection
# Highest score by int value "wins".
my $protscore=0;
Line 269 ⟶ 271:
if($p->{'ns'}==8 && ($p->{'contentmodel'} eq 'javascript' || $t=~m!\.js$!)){
$pd->{'prottype'}='Site JS page';
$protscore=
} elsif($p->{'ns'}==8 && ($p->{'contentmodel'} eq 'css' || $t=~m!\.css$!)){
$pd->{'prottype'}='Site CSS page';
$protscore=
} elsif($p->{'ns'}==8){
$pd->{'prottype'}='MediaWiki page';
$protscore=
} elsif($p->{'ns'}==2 && ($p->{'contentmodel'} eq 'javascript' || $t=~m!/.*\.js$!)){
$pd->{'prottype'}='User JS page';
$protscore=
} elsif($p->{'ns'}==2 && ($p->{'contentmodel'} eq 'css' || $t=~m!/.*\.css$!)){
$pd->{'prottype'}='User CSS page';
$protscore=0x100;
} elsif($p->{'ns'}==2 && ($p->{'contentmodel'} eq 'json' || $t=~m!/.*\.json$!)){
$pd->{'prottype'}='User JSON page';
$protscore=0x80;
}
Line 306 ⟶ 311:
next unless $pp->{'type'} eq $prottype;
my $sc=0;
$sc|=
$sc|=0x40 if $pp->{'level'} eq 'templateeditor';
$sc|=0x20 if $pp->{'level'} eq 'extendedconfirmed';
$sc|=0x10 if $pp->{'level'} eq 'autoconfirmed';
$sc|=exists($pp->{'source'})?
$sc|=
next if $sc<$protscore;
if(exists($pp->{'source'})){
Line 337 ⟶ 342:
if($protscore & 0x40){
$pd->{'color'}=$colors->[4] if($protscore & 0x40);
$pd->{'color'}=$colors->[
}
$pd->{'color'}=$colors->[5] if($protscore & 0x80);
$pd->{'color'}=$colors->[6] if($protscore & 0x100);
$pd->{'color'}=$colors->[
$pd->{'color'}=$colors->[9] if($protscore &
$pd->{'color'}=$colors->[10] if($protscore &
$pd->{'color'}=$colors->[11] if($protscore & 0x8000);
$pd->{'color'}='green' if($pd->{'color'} eq 'clear' && grep($p->{'ns'}==$_, @$greenns));
|