Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item14462: Make AuthScripts visible in configure
And allow for LoginManagers to inherit from TemplateLogin when checking
the values.
  • Loading branch information
gac410 committed Aug 23, 2017
1 parent 0ce6a60 commit 2d1a826
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/lib/Foswiki.spec
Expand Up @@ -420,7 +420,7 @@ $Foswiki::cfg{LoginManager} = 'Foswiki::LoginManager::TemplateLogin';
# Write debugging output to the webserver error log.
$Foswiki::cfg{Trace}{LoginManager} = 0;

# **STRING 100 LABEL="Authenticated Scripts" DISPLAY_IF="{LoginManager}=='Foswiki::LoginManager::TemplateLogin'" CHECK="iff:'{LoginManager} =~ /TemplateLogin$/'" CHECK_ON_CHANGE="{LoginManager}" **
# **STRING 100 LABEL="Authenticated Scripts" CHECK_ON_CHANGE="{LoginManager}" **
# Comma-separated list of scripts in the bin directory that require the user to
# authenticate. This setting is used with TemplateLogin; any time an
# unauthenticated user attempts to access one of these scripts, they will be
Expand Down
15 changes: 9 additions & 6 deletions core/lib/Foswiki/Configure/Checkers/AuthScripts.pm
Expand Up @@ -8,8 +8,13 @@ use Foswiki::Configure::Checker ();
our @ISA = ('Foswiki::Configure::Checker');

sub check_current_value {
my ($this, $reporter) = @_;
my $msg = '';
my ( $this, $reporter ) = @_;
my $msg = '';

my $templateLogin = eval {
$Foswiki::cfg{LoginManager}
->isa('Foswiki::LoginManager::TemplateLogin');
};

if ( $Foswiki::cfg{AuthScripts} ) {
if ( $Foswiki::cfg{LoginManager} eq 'none' ) {
Expand All @@ -20,9 +25,7 @@ other than 'none' or clear this setting.
EOF
}

if ( $Foswiki::cfg{LoginManager} ne
'Foswiki::LoginManager::TemplateLogin' )
{
unless ($templateLogin) {
$reporter->WARN(<<'EOF');
You have specified an alternative (non-TemplateLogin) login manager.
It is critical that this list of scripts be consistent with the scripts
Expand Down Expand Up @@ -71,7 +74,7 @@ HERE
closedir(D);

$reporter->NOTE(
"The following scripts can be run by unauthenticated users: =$unauth=" )
"The following scripts can be run by unauthenticated users: =$unauth=")
if $unauth;

if ( $unauth =~ m/auth\b/ ) {
Expand Down

0 comments on commit 2d1a826

Please sign in to comment.