diff --git a/data/System/VarTAGSEARCH.txt b/data/System/VarTAGSEARCH.txt index c7a5946..aeb9bba 100644 --- a/data/System/VarTAGSEARCH.txt +++ b/data/System/VarTAGSEARCH.txt @@ -12,7 +12,7 @@ | =user="wikiname"=
=user="all"= | Filter the =user= dimension with this setting. Leave out the =%MAINWEB%= part here.
*Note:* This is forced to the current user, if the =visibility= is set to =private=. | ="all"= | | =web="Name"=
=web="%USERSWEB%, Know"=
=web="all"= | Comma-separated list of webs to search. The special word =all= means all webs (inlcuding those which have the =NOSEARCHALL= preference set to =on=). Use =%= as a wildcard. | ="all"= | | =topic="Name"=
=topic="TestTopic1, TestTopic2"=
=topic="all"= | Comma-separated list of topics (without a webname) to search. The special word =all= means all topics. Use =%= as a wildcard. | ="all"= | - | =visibility="all"=
=visibility="public"=
=visibility="private"=
=visibility="user"= | Filter by the public flag: either show all, only public or only private tags. =user= is a combination of "all public tags" and "my private tags".
*Note:* You *must not* set a =user= parameter with =visibility=user=. | ="all"= | + | =visibility="all"=
=visibility="public"=
=visibility="private"=
=visibility="user"= | Filter by the public flag: either show all, only public or only private tags. =user= is a combination of "all public tags" and "my private tags".
*Note:* You *must not* set a =user= parameter with =visibility=user=. =all= is limited to admins. | ="user"= | | =header="..."=
=format="..."=
=footer="..."= | Custom format results: see table below for allowed variables. | depending on the =query= parameter, a simple list | | =alt="..."= | If nothing is found, =alt= is returned instead of =header=, =format= and =footer=. | =empty= | | =separator=", "=
=sep=", "= | Separator _between_ search hits | =", "= | diff --git a/lib/Foswiki/Plugins/TagsPlugin/TAGSEARCH.pm b/lib/Foswiki/Plugins/TagsPlugin/TAGSEARCH.pm index 9f0aaaa..3ec4abe 100644 --- a/lib/Foswiki/Plugins/TagsPlugin/TAGSEARCH.pm +++ b/lib/Foswiki/Plugins/TagsPlugin/TAGSEARCH.pm @@ -44,7 +44,7 @@ sub do { my $theTopic = $params->{topic} || ''; my $theQuery = $params->{query} || 'tag'; my $theOrder = $params->{order} || ''; - my $thePublic = $params->{visibility} || 'all'; + my $thePublic = $params->{visibility} || 'user'; my $theAlt = $params->{alt} || ''; my $theLimit = $params->{limit} || 0; my $theOffset = $params->{offset} || 0; @@ -81,6 +81,10 @@ sub do { Foswiki::Func::isGroupMember( $Foswiki::cfg{TagsPlugin}{TagAdminGroup} || "AdminGroup" ) ? 1 : 0; + if ( $thePublic =~ /^all$/i && !$isTagAdmin ) { + $thePublic = "user"; + } + my $output = ''; my $statement = ''; my @whereClauses;