Page MenuHomePhabricator

Enable ProtectSection on Wikisource websites
Closed, DeclinedPublic

Assigned To
None
Authored By
bzimport
Dec 24 2005, 12:12 AM
Referenced Files
F2554: ProtectSection.php
Nov 21 2014, 9:01 PM
F2553: patch
Nov 21 2014, 9:00 PM
F2552: Protect.php
Nov 21 2014, 9:00 PM

Description

Author: thomasV1

Description:
Some wikimedia projects (Wikisource) would largely benefit from a method to
partially protect the text of an article.

A new syntax would delimit protected sections, e.g. <protect>protected
text</protect>, or maybe <div class="protected">. Protected text may be edited
only by sysops. Other parts of the text may be edited by anybody.

No modification of the edit window is required in order to implement this. If a
user who is not allowed tries to edit a protected section, he will simply
receive an error message when he submits his text, (or something similar to what
one gets in case of edit conflict).

Needless to say, unpriviledged users should not be allowed to add new <protect>
tags to articles.


Version: unspecified
Severity: enhancement
URL: http://thecircle.dyndns.org/wiki/index.php/Apple

Details

Reference
bz4375

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 9:00 PM
bzimport set Reference to bz4375.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

*** Bug 4376 has been marked as a duplicate of this bug. ***

ezyang wrote:

You may want to consider, instead, protecting sections, which MediaWiki is far
more aware of and can simply strip out of edit box before other users get to it.

I guess transclusion is too clunky for the task.

thomasV1 wrote:

ok, made a crude implementation of it.
Here is an example: http://thecircle.dyndns.org/wiki/index.php/Apple

I will attach my code once I have figured out how to make it an extension.

thomasV1 wrote:

extension file

ok, created an extension.

attachment Protect.php ignored as obsolete

thomasV1 wrote:

extension file

don't call error_reporting()
don't use private field mOutputType

attachment Protect.php ignored as obsolete

thomasV1 wrote:

extension file, corrected after feedback by avar & hashar

implements a new permission
messages can be localized

Attached:

Commited as 'ProtectSection' directory in module 'extensions'.

thomasV1 wrote:

could this extension be enabled on Wikisource? I tested it on my own wiki, and
it was also successfully installed on ihate.org.uk.

thomasV1 wrote:

following Angela's suggestion, I organised a vote :
http://wikisource.org/wiki/Wikisource:Vote_on_enabling_the_ProtectSection_extension

Given the tremendous support in favor of this extension, I hereby request its
activation.

mysekurity wrote:

Any thoughts about implementing [[Wikipedia:Semi-protection
Policy|Semi-protection]]? This would be useful for things that don't change too
much and get constantly vandalized, like Record Sales or facts that keep getting
incorrectly modified (like Howard Zinn's birthdate).

bill.glesener wrote:

(In reply to comment #7)

Commited as 'ProtectSection' directory in module 'extensions'.

Is there a particular way to install this to an existing wiki? I copied the
Protect.php script to extensions and pointed the LocalSettings.php to that file.
When I try to use the <protect></protect> tags, they work when the section is
edited, but not if the entire article or higher heading is edited. Is there more
to using this extension than what I did?

thomasV1 wrote:

bugfix + "protected" div

there was a bug in the regexp, this patche fixes it.

it also surrounds protected text with "<div class=protected> </div>", so that a
user can set his/her preferences to make protected sections visible.

attachment patch ignored as obsolete

thomasV1 wrote:

minor change to previous...

Attached:

Birgitte_SB wrote:

(In reply to Comment number 10)

This is not about vandalism. Wikisource has a policy of protecting throughly
proof-read sources for integrity issues. This bug would allow a section to
remain open for editing which could contain a short introduction or other notes.
For more details read the Scriptorium at the mulitilingual Wikisource as well
as the English policy pages on text integrity.

rotemliss wrote:

Applied the fix to r16619. Please open another bug to ask the ProtectSection
extension to be enabled on Wikisource sites.

rotemliss wrote:

OK - this bug is referenced from some places, therefore I'm reopening it a
request to enable the extension.

The extension doesn't work with section editing.

thomasV1 wrote:

What do you mean by that ? It is not supposed to work that way...

jimhu wrote:

Proposed alternative version of ProtectSection

I modified ProtectSection to remove Section Edit links for unauthorized users
within the protected block of text. This involved moving wfStripProtectTags to
run under ParserAfterTidy.

attachment ProtectSection.php ignored as obsolete

ssanbeg wrote:

(In reply to comment #19)

Created an attachment (id=3158) [edit]
Proposed alternative version of ProtectSection

I modified ProtectSection to remove Section Edit links for unauthorized users
within the protected block of text. This involved moving wfStripProtectTags to
run under ParserAfterTidy.

That probably won't work well with caching; the presence/absence of links would
reflect the user the request that parsed the version in cache, not the user that
is viewing the cached version.

jimhu wrote:

Bug fix to previous submission. Now handles section edits better.

The previous version blocked editing of an unprotected section followed by a
protected section. This version should work better for section-level edits.

Attached:

jimhu wrote:

(In reply to comment #20)

(In reply to comment #19)

Created an attachment (id=3158) [edit] [edit]
Proposed alternative version of ProtectSection

I modified ProtectSection to remove Section Edit links for unauthorized users
within the protected block of text. This involved moving wfStripProtectTags to
run under ParserAfterTidy.

That probably won't work well with caching; the presence/absence of links would
reflect the user the request that parsed the version in cache, not the user that
is viewing the cached version.

I don't have caching set up on my wiki, so I can't test this.