diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:32:26 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:32:26 -0700 |
commit | 026dc7ad72ba972f230b6709e31fa64397d75ad4 (patch) | |
tree | c5af1a7ac9154744afc3660e9a9405892f2bb50b /rt/lib/RT/Test/Apache.pm | |
parent | 07b4bc84d1078f7390221d766cdb3142513db4b0 (diff) | |
parent | 1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 (diff) |
merge RT 4.2.11 and Header changes to disable RT javascript, RT#34237
Diffstat (limited to 'rt/lib/RT/Test/Apache.pm')
-rw-r--r-- | rt/lib/RT/Test/Apache.pm | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/rt/lib/RT/Test/Apache.pm b/rt/lib/RT/Test/Apache.pm index f761e3cee..29f5ed1be 100644 --- a/rt/lib/RT/Test/Apache.pm +++ b/rt/lib/RT/Test/Apache.pm @@ -83,6 +83,23 @@ sub basic_auth { EOT } +sub basic_auth_anon { + my $self = shift; + + return <<"EOT"; + AuthType Basic + AuthName "restricted area" + AuthBasicProvider anon + + Anonymous * + Anonymous_NoUserID On + Anonymous_MustGiveEmail Off + Anonymous_VerifyEmail Off + + Require valid-user +EOT +} + sub start_server { my ($self, %config) = @_; my %tmp = %{$config{tmp}}; @@ -108,8 +125,14 @@ sub start_server { rt_sbin_path => $RT::SbinPath, rt_site_config => $ENV{'RT_SITE_CONFIG'}, load_modules => $info{load_modules}, - basic_auth => $config{basic_auth} ? $self->basic_auth : "", ); + if (not $config{basic_auth}) { + $opt{basic_auth} = ""; + } elsif ($config{basic_auth} eq 'anon') { + $opt{basic_auth} = $self->basic_auth_anon; + } else { + $opt{basic_auth} = $self->basic_auth; + } foreach (qw(log pid lock)) { $opt{$_ .'_file'} = File::Spec->catfile( "$tmp{'directory'}", "apache.$_" @@ -193,7 +216,10 @@ sub apache_server_info { ) unless exists $MODULES{$res{version}}{$res{variant}}; my @mlist = @{$MODULES{$res{version}}{$res{variant}}}; - push @mlist, "authn_file", "auth_basic", "authz_user" if $res{basic_auth}; + if ($res{basic_auth}) { + push @mlist, "auth_basic", "authz_user"; + push @mlist, $res{basic_auth} eq 'anon' ? "authn_anon" : "authn_file"; + } $res{'load_modules'} = ''; foreach my $mod ( @mlist ) { |