From 3c3aee9f4dd336e7e7a98aab5541ab8903d86e28 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 2 Jul 2023 13:09:18 +0200 Subject: [PATCH 1/4] Add some ApprovedRevs settings Phabricator task: https://phabricator.miraheze.org/T10924 --- ManageWikiSettings.php | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/ManageWikiSettings.php b/ManageWikiSettings.php index dbf5cb7972..3ee638bec4 100644 --- a/ManageWikiSettings.php +++ b/ManageWikiSettings.php @@ -212,6 +212,51 @@ 'help' => 'Uncheck this box to require new revisions to be manually approved even if made by an administrator', 'requires' => [], ], + 'egApprovedRevsBlankIfUnapproved' => [ + 'name' => 'Display unapproved pages as blank', + 'from' => 'approvedrevs', + 'type' => 'check', + 'overridedefault' => true, + 'section' => 'anti-spam', + 'help' => 'Make pages without approved revisions show up as blank', + 'requires' => [], + ], + 'egApprovedRevsBlankFileIfUnapproved' => [ + 'name' => 'Do not display unapproved images', + 'from' => 'approvedrevs', + 'type' => 'check', + 'overridedefault' => true, + 'section' => 'anti-spam', + 'help' => 'Makes files without approved versions not show up when embedded', + 'requires' => [], + ], + 'egApprovedRevsFileAutomaticApprovals' => [ + 'name' => 'Automatically approve new files', + 'from' => 'approvedrevs', + 'type' => 'check', + 'overridedefault' => true, + 'section' => 'anti-spam', + 'help' => 'Uncheck this to require new files to be manually approved even if made by an administrator', + 'requires' => [], + ], + 'egApprovedRevsFileShowApproveLatest' => [ + 'name' => 'Show a link to approve the latest revision in Special:ApprovedRevs', + 'from' => 'approvedrevs', + 'type' => 'check', + 'overridedefault' => true, + 'section' => 'anti-spam', + 'help' => '', + 'requires' => [], + ], + 'egApprovedRevsFileAutomaticApprovals' => [ + 'name' => 'Automatically approve new files', + 'from' => 'approvedrevs', + 'type' => 'check', + 'overridedefault' => true, + 'section' => 'anti-spam', + 'help' => 'Uncheck this to require new files to be manually approved even if made by an administrator', + 'requires' => [], + ], 'wgFlaggedRevsProtection' => [ 'name' => 'Flagged Revs Protection', 'from' => 'flaggedrevs', From 9fd725b89e6e3956b150199ec833b0ec49c59f37 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 2 Jul 2023 13:15:28 +0200 Subject: [PATCH 2/4] Add ShowNotApprovedMessage --- ManageWikiSettings.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ManageWikiSettings.php b/ManageWikiSettings.php index 3ee638bec4..fb1c4db1ea 100644 --- a/ManageWikiSettings.php +++ b/ManageWikiSettings.php @@ -248,13 +248,13 @@ 'help' => '', 'requires' => [], ], - 'egApprovedRevsFileAutomaticApprovals' => [ - 'name' => 'Automatically approve new files', + 'egApprovedRevsShowNotApprovedMessage' => [ + 'name' => 'Show not approved message', 'from' => 'approvedrevs', 'type' => 'check', 'overridedefault' => true, 'section' => 'anti-spam', - 'help' => 'Uncheck this to require new files to be manually approved even if made by an administrator', + 'help' => '', 'requires' => [], ], 'wgFlaggedRevsProtection' => [ From 29506b4a0eee29ec3549bc94c34c6475b355a753 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 19 Oct 2023 19:30:55 +0200 Subject: [PATCH 3/4] Add help strings. --- ManageWikiSettings.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ManageWikiSettings.php b/ManageWikiSettings.php index fb1c4db1ea..6b17a2d1f9 100644 --- a/ManageWikiSettings.php +++ b/ManageWikiSettings.php @@ -245,7 +245,7 @@ 'type' => 'check', 'overridedefault' => true, 'section' => 'anti-spam', - 'help' => '', + 'help' => 'This option makes a link show up on Special:ApprovedRevs to approve the latest revision of a file', 'requires' => [], ], 'egApprovedRevsShowNotApprovedMessage' => [ @@ -254,7 +254,7 @@ 'type' => 'check', 'overridedefault' => true, 'section' => 'anti-spam', - 'help' => '', + 'help' => 'This option makes a message appear on unapproved revisions indicating this revision has not been approved', 'requires' => [], ], 'wgFlaggedRevsProtection' => [ From a6f1f0e893ad0c20db9a55ac164f52fddddf26a1 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 19 Oct 2023 19:41:35 +0200 Subject: [PATCH 4/4] Change Overridedefault The description for overridedefault says (https://github.com/miraheze/mw-config/blob/29506b4a0eee29ec3549bc94c34c6475b355a753/ManageWikiSettings.php#L11) "a string/array override default when no existing value exist." If I'm understanding this correctly, this means ManageWiki will use this value if one has not been configured by the wiki's bureaucrats. I've changed this to the defaults at https://github.com/wikimedia/mediawiki-extensions-ApprovedRevs/blob/75e657c4533c51078b10735ec0e2366dc099e051/extension.json. This should make it so that there are no changes to wikis' existing ApprovedRevs config. --- ManageWikiSettings.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ManageWikiSettings.php b/ManageWikiSettings.php index 6b17a2d1f9..2149daa9c1 100644 --- a/ManageWikiSettings.php +++ b/ManageWikiSettings.php @@ -216,7 +216,7 @@ 'name' => 'Display unapproved pages as blank', 'from' => 'approvedrevs', 'type' => 'check', - 'overridedefault' => true, + 'overridedefault' => false, 'section' => 'anti-spam', 'help' => 'Make pages without approved revisions show up as blank', 'requires' => [], @@ -225,7 +225,7 @@ 'name' => 'Do not display unapproved images', 'from' => 'approvedrevs', 'type' => 'check', - 'overridedefault' => true, + 'overridedefault' => false, 'section' => 'anti-spam', 'help' => 'Makes files without approved versions not show up when embedded', 'requires' => [], @@ -243,7 +243,7 @@ 'name' => 'Show a link to approve the latest revision in Special:ApprovedRevs', 'from' => 'approvedrevs', 'type' => 'check', - 'overridedefault' => true, + 'overridedefault' => false, 'section' => 'anti-spam', 'help' => 'This option makes a link show up on Special:ApprovedRevs to approve the latest revision of a file', 'requires' => [], @@ -252,7 +252,7 @@ 'name' => 'Show not approved message', 'from' => 'approvedrevs', 'type' => 'check', - 'overridedefault' => true, + 'overridedefault' => false, 'section' => 'anti-spam', 'help' => 'This option makes a message appear on unapproved revisions indicating this revision has not been approved', 'requires' => [],