Skip to content

Commit

Permalink
Item13852: Warn that COMMENT ACLs are needed.
Browse files Browse the repository at this point in the history
Also suppress the warning about guest sessions on Foswiki 1.1. Systems.
  • Loading branch information
gac410 committed Nov 16, 2015
1 parent 8e15ea1 commit 275ba8a
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 10 deletions.
21 changes: 14 additions & 7 deletions CommentPlugin/data/System/CommentPlugin.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1443575942" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1447639365" format="1.1" version="1"}%
%META:TOPICPARENT{name="Plugins"}%
---+!! Comment Plugin

Expand Down Expand Up @@ -242,7 +242,13 @@ Note that these position tags are obviously mutually exclusive. If you define mo
All the [[TemplateTopics#TemplateTopicsVars][usual macros]] that can be used in a topic template can also be used in an =OUTPUT= template.

---+++ Custom access controls
Using =configure=, the plugin can be configured to use a different access control domain than the default CHANGE. This allows you to use the plugin to add content to topics where the commenting user does not have CHANGE (or even VIEW) access.
Using =configure=, the plugin can be configured to use a different access control domain than the default CHANGE.
This allows you to use the plugin to add content to topics where the commenting user does not have CHANGE (or even VIEW) access.

<div class="foswikiHelp">%X% *Caution* If you configure this plugin to use =COMMENT= permission instead of =CHANGE=, you should ensure that every web has the desired
default permission by configuring =ALLOWWEBCOMMENT= or =DENYWEBCOMMENT= in every !WebPreferences topic. You should also configure appropriate defaults in the =_default= Template web.
If default permissions are not configured, then commenting will be permitted.
</div>

---++ Settings
<!-- Not used by the plugin
Expand Down Expand Up @@ -273,6 +279,7 @@ This plugin has been significantly changed from the =10 April 2011= version ship
Another great extension from the <a style="text-decoration:none" href="http://wikiring.com"><img src="%ATTACHURLPATH%/wikiringlogo20x20.png" alt="" /> *WikiRing* </a> - working together to improve your wiki experience!

| Change History: | |
| 2.8 (15 Nov 2015) | Foswikitask:Item13852: Warn that COMMENT ACLs should be configured if enabled. Also suppress guest session warning on Foswiki 1.1. |
| 2.7 (29 Sep 2015) | Foswikitask:Item13576: Disable fields during submit, then clear input fields after comment is posted.<br/>\
Foswikitask:Item13764: Entity encode any comments by guest users. |
| 2.6 (24 Jul 2015) | Foswikitask:Item13502: Expand macros when returning an inline Ajax response. |
Expand Down Expand Up @@ -323,8 +330,8 @@ Another great extension from the <a style="text-decoration:none" href="http://wi
%META:FIELD{name="License" title="License" value="GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]])"}%
%META:FIELD{name="Home" title="Home" value="http://foswiki.org/Extensions/CommentPlugin"}%
%META:FIELD{name="Support" title="Support" value="http://foswiki.org/Support/CommentPlugin"}%
%META:FILEATTACHMENT{name="comment.uncompressed.css" attr="h" comment="" date="1443575942" size="70" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="comment.js" attr="h" comment="" date="1443575942" size="1931" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="comment.css" attr="h" comment="" date="1443575942" size="60" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="comment.uncompressed.js" attr="h" comment="" date="1443575942" size="5134" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="wikiringlogo20x20.png" attr="h" comment="" date="1443575942" size="1343" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="comment.uncompressed.css" attr="h" comment="" date="1447639365" size="70" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="comment.js" attr="h" comment="" date="1447639365" size="1931" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="comment.css" attr="h" comment="" date="1447639365" size="60" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="comment.uncompressed.js" attr="h" comment="" date="1447639365" size="5134" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="wikiringlogo20x20.png" attr="h" comment="" date="1447639365" size="1343" user="ProjectContributor" version="1"}%
Expand Up @@ -22,7 +22,9 @@ by guests will not be possible.
EOF
);
}
if ( !$Foswiki::cfg{Sessions}{EnableGuestSessions} ) {
if ( !$Foswiki::cfg{Sessions}{EnableGuestSessions}
&& $Foswiki::VERSION > 2.0.0 )
{
$msg .= $this->WARN(
<<'EOF'
Guest sessions should be enabled so that Foswiki validation can be performed.
Expand Down
@@ -0,0 +1,56 @@
# See bottom of file for license and copyright information
package Foswiki::Configure::Checkers::Plugins::CommentPlugin::RequiredForSave;

use strict;
use warnings;

use Foswiki::Configure::Checker ();
our @ISA = ('Foswiki::Configure::Checker');

sub check {
my $this = shift;
my $msg = '';

if ( $Foswiki::cfg{Plugins}{CommentPlugin}{RequiredForSave}
&& $Foswiki::cfg{Plugins}{CommentPlugin}{RequiredForSave} ne 'CHANGE' )
{

$msg .= $this->WARN(
<<'EOF'
Commenting will be allowed by default unless a default ACL is configured for each web.
Make certain that an explicit ALLOWWEBCOMMENT or a DENYWEBCOMMENT is configured in every web.
You should consider adding an appropriate default into the '_default' template web to protect
newly created webs.
EOF
);
}

return $msg;
}

1;
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Copyright (C) 2008-2014 Foswiki Contributors. Foswiki Contributors
are listed in the AUTHORS file in the root of this distribution.
NOTE: Please extend that file, not this notice.
Additional copyrights apply to some or all of the code in this
file as follows:
Copyright (C) 2000-2006 TWiki Contributors. All Rights Reserved.
TWiki Contributors are listed in the AUTHORS file in the root
of this distribution. NOTE: Please extend that file, not this notice.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. For
more details read LICENSE in the root of this distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
As per the GPL, removal of this notice is prohibited.
4 changes: 2 additions & 2 deletions CommentPlugin/lib/Foswiki/Plugins/CommentPlugin.pm
Expand Up @@ -13,8 +13,8 @@ use Foswiki::Func ();
use Foswiki::Plugins ();

# Please use major.minor
our $VERSION = '2.7';
our $RELEASE = '29 Sep 2015';
our $VERSION = '2.8';
our $RELEASE = '15 Nov 2015';
our $SHORTDESCRIPTION =
'Quickly post comments to a page without an edit/save cycle';
our $NO_PREFS_IN_TOPIC = 1;
Expand Down
1 change: 1 addition & 0 deletions CommentPlugin/lib/Foswiki/Plugins/CommentPlugin/MANIFEST
Expand Up @@ -11,6 +11,7 @@ lib/Foswiki/Plugins/CommentPlugin/Comment.pm 0444 Plugin Perl module
lib/Foswiki/Plugins/CommentPlugin/Config.spec 0444 Configuration module
lib/Foswiki/Plugins/CommentPlugin/JQuery.pm 0644
lib/Foswiki/Configure/Checkers/Plugins/CommentPlugin/GuestCanComment.pm 0644
lib/Foswiki/Configure/Checkers/Plugins/CommentPlugin/RequiredForSave.pm 0644
pub/System/CommentPlugin/wikiringlogo20x20.png 0644
pub/System/CommentPlugin/comment.css 0644
pub/System/CommentPlugin/comment.js 0644
Expand Down

0 comments on commit 275ba8a

Please sign in to comment.