Skip to content

Commit

Permalink
Item14030: Fix invalid utf-8 in topic
Browse files Browse the repository at this point in the history
Also fix SVN version strings, remove TWiki references,
Delete a bunch of the old boilerplate, and add a
Config.spec for the debug option.
  • Loading branch information
gac410 committed Mar 20, 2016
1 parent e703ca1 commit b2451e0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 61 deletions.
9 changes: 5 additions & 4 deletions data/System/HttpsRedirectPlugin.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="StephaneLenclud" date="1240882180" format="1.1" reprev="1.2" version="1.2"}%
%META:TOPICINFO{author="ProjectContributor" date="1458439803" format="1.1" version="1.2"}%
%META:TOPICPARENT{name="Plugins"}%
---+!! !HttpsRedirectPlugin
<!--
Expand All @@ -25,11 +25,12 @@ Many thanks to the following sponsors for supporting this work:
* http://slion.net

| Plugin Author(s): | Foswiki:Main.StephaneLenclud |
| Copyright: | &copy; 2008-2009 StphaneLenclud |
| Copyright: | &copy; 2008-2009 St&eacute;phaneLenclud, 2011-2016 Foswiki Contributors |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
| Plugin Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 28 Mar 2011 | v1.1 Foswikitask:10551 - fixed a problem where foswiki scripts would produce no output if run from CLI |
| 19 mar 2016 | v1.2 Foswikitask:Item14030 - Use new version strings, remove non-utf8 characters from topic. Other minor cleanup. |
| 28 Mar 2011 | v1.1 Foswikitask:Item10551 - fixed a problem where foswiki scripts would produce no output if run from CLI |
| 28 Apr 2009 | v1.0 First actually working version for Foswiki |
| Dependencies: | %$DEPENDENCIES% |
| Plugin Home: | http://foswiki.org/Extensions/HttpsRedirectPlugin |
Expand All @@ -39,4 +40,4 @@ Many thanks to the following sponsors for supporting this work:

__Related Topics:__ [[%SYSTEMWEB%.Plugins][Plugins]], %SYSTEMWEB%.DeveloperDocumentationCategory, %SYSTEMWEB%.AdminDocumentationCategory, %SYSTEMWEB%.DefaultPreferences, %USERSWEB%.SitePreferences

<!-- Do _not_ attempt to edit this topic; it is auto-generated. Please add comments/questions/remarks to the feedback topic on twiki.org instead. -->
<!-- Do _not_ attempt to edit this topic; it is auto-generated. Please add comments/questions/remarks to the support topic on foswiki.org instead. -->
60 changes: 7 additions & 53 deletions lib/Foswiki/Plugins/HttpsRedirectPlugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
---+ package Foswiki::Plugins::HttpsRedirectPlugin
To interact with TWiki use ONLY the official API functions
To interact with Foswiki use ONLY the official API functions
in the Foswiki::Func module. Do not reference any functions or
variables elsewhere in TWiki, as these are subject to change
variables elsewhere in Foswiki, as these are subject to change
without prior warning, and your plugin may suddenly stop
working.
Expand All @@ -28,15 +28,15 @@ delete the whole of handlers you don't use before you release your
plugin.
__NOTE:__ When developing a plugin it is important to remember that
TWiki is tolerant of plugins that do not compile. In this case,
Foswiki is tolerant of plugins that do not compile. In this case,
the failure will be silent but the plugin will not be available.
See [[%SYSTEMWEB%.Plugins#FAILEDPLUGINS]] for error messages.
__NOTE:__ Defining deprecated handlers will cause the handlers to be
listed in [[%SYSTEMWEB%.Plugins#FAILEDPLUGINS]]. See
[[%SYSTEMWEB%.Plugins#Handlig_deprecated_functions]]
for information on regarding deprecated handlers that are defined for
compatibility with older TWiki versions.
compatibility with older Foswiki versions.
__NOTE:__ When writing handlers, keep in mind that these may be invoked
on included topics. For example, if a plugin generates links to the current
Expand All @@ -54,31 +54,15 @@ use strict;
require Foswiki::Func; # The plugins API
require Foswiki::Plugins; # For the API version

# $VERSION is referred to by TWiki, and is the only global variable that
# *must* exist in this package.
#use vars qw( $VERSION $RELEASE $SHORTDESCRIPTION $debug $pluginName $NO_PREFS_IN_TOPIC );

# This should always be $Rev$ so that TWiki can determine the checked-in
# status of the plugin. It is used by the build automation tools, so
# you should leave it alone.
our $VERSION = '$Rev$ (2011-03-28)';

# This is a free-form string you can use to "name" your own plugin version.
# It is *not* used by the build automation tools, but is reported as part
# of the version number in PLUGINDESCRIPTIONS.
our $RELEASE = '1.1';
our $VERSION = '1.2';
our $RELEASE = '19 Mar 2016';

# Short description of this plugin
# One line description, is shown in the %SYSTEMWEB%.TextFormattingRules topic:
our $SHORTDESCRIPTION = 'Redirect authenticated users to HTTPS url.';

# You must set $NO_PREFS_IN_TOPIC to 0 if you want your plugin to use preferences
# stored in the plugin topic. This default is required for compatibility with
# older plugins, but imposes a significant performance penalty, and
# is not recommended. Instead, use $Foswiki::cfg entries set in LocalSite.cfg, or
# if you want the users to be able to change settings, then use standard TWiki
# preferences that can be defined in your %USERSWEB%.SitePreferences and overridden
# at the web and topic level.
# stored in the plugin topic.
our $NO_PREFS_IN_TOPIC = 1;

# Name of this Plugin, only used in this module
Expand All @@ -94,28 +78,6 @@ our $debug = 0;
* =$user= - the login name of the user
* =$installWeb= - the name of the web the plugin is installed in
REQUIRED
Called to initialise the plugin. If everything is OK, should return
a non-zero value. On non-fatal failure, should write a message
using Foswiki::Func::writeWarning and return 0. In this case
%FAILEDPLUGINS% will indicate which plugins failed.
In the case of a catastrophic failure that will prevent the whole
installation from working safely, this handler may use 'die', which
will be trapped and reported in the browser.
You may also call =Foswiki::Func::registerTagHandler= here to register
a function to handle variables that have standard TWiki syntax - for example,
=%MYTAG{"my param" myarg="My Arg"}%. You can also override internal
TWiki variable handling functions this way, though this practice is unsupported
and highly dangerous!
__Note:__ Please align variables names with the Plugin name, e.g. if
your Plugin is called FooBarPlugin, name variables FOOBAR and/or
FOOBARSOMETHING. This avoids namespace issues.
=cut

sub initPlugin {
Expand Down Expand Up @@ -193,14 +155,6 @@ sub initPlugin {
}
}

# register the _EXAMPLETAG function to handle %EXAMPLETAG{...}%
# This will be called whenever %EXAMPLETAG% or %EXAMPLETAG{...}% is
# seen in the topic text.
#Foswiki::Func::registerTagHandler( 'EXAMPLETAG', \&_EXAMPLETAG );

# Allow a sub to be called from the REST interface
# using the provided alias
#Foswiki::Func::registerRESTHandler('example', \&restExample);

# Plugin correctly initialized
return 1;
Expand Down
7 changes: 7 additions & 0 deletions lib/Foswiki/Plugins/HttpsRedirectPlugin/Config.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ---+ Extensions
# ---++ HttpsRedirectPlugin
# **BOOLEAN LABEL="Redirect debugging"**
# Enable this parameter to write debug information about redirects to the debug log.
$Foswiki::cfg{Plugins}{HttpsRedirectPlugin}{Debug} = '0';
1;

7 changes: 3 additions & 4 deletions lib/Foswiki/Plugins/HttpsRedirectPlugin/MANIFEST
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Release manifest for HttpsRedirectPlugin
data/System/HttpsRedirectPlugin.txt 0644 Documentation
lib/Foswiki/Plugins/HttpsRedirectPlugin.pm 0644 Perl module

data/System/HttpsRedirectPlugin.txt 0644
lib/Foswiki/Plugins/HttpsRedirectPlugin.pm 0644
lib/Foswiki/Plugins/HttpsRedirectPlugin/Config.spec 0664

0 comments on commit b2451e0

Please sign in to comment.