Skip to content

Commit bf987a7

Browse files
SvenDowideitSvenDowideit
authored andcommitted
Item9593: add some feedback for the admin if their setup implies Apache Digest Auth. I didn't find a way for our cgi app to ask apache what its setting for AuthName is
git-svn-id: http://svn.foswiki.org/trunk@8833 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
1 parent eae2764 commit bf987a7

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# See bottom of file for license and copyright information
2+
package Foswiki::Configure::Checkers::AuthRealm;
3+
4+
use strict;
5+
use warnings;
6+
7+
use Foswiki::Configure::Checker ();
8+
our @ISA = ('Foswiki::Configure::Checker');
9+
10+
sub check {
11+
my $this = shift;
12+
13+
if ( !$Foswiki::cfg{AuthRealm} ) {
14+
return $this->ERROR(
15+
'Please make sure you enter an Authentication Realm. This is required for registration to work.'
16+
);
17+
}
18+
19+
if (( $Foswiki::cfg{AuthRealm} =~ /\:/ ) and
20+
# ($Foswiki::cfg{AuthRealm} eq 'Foswiki::LoginManager::ApacheLogin') and
21+
($Foswiki::cfg{Htpasswd}{Encoding} eq 'md5')) {
22+
return $this->ERROR("Digest auth (md5) password files store the AuthRealm in the password file, which uses ':' (colons) as the data separator. Please remove the colon from the Setting.");
23+
}
24+
return '';
25+
}
26+
27+
1;
28+
__END__
29+
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
30+
31+
Copyright (C) 2008-2010 Foswiki Contributors. Foswiki Contributors
32+
are listed in the AUTHORS file in the root of this distribution.
33+
NOTE: Please extend that file, not this notice.
34+
35+
Additional copyrights apply to some or all of the code in this
36+
file as follows:
37+
38+
Copyright (C) 2000-2006 TWiki Contributors. All Rights Reserved.
39+
TWiki Contributors are listed in the AUTHORS file in the root
40+
of this distribution. NOTE: Please extend that file, not this notice.
41+
42+
This program is free software; you can redistribute it and/or
43+
modify it under the terms of the GNU General Public License
44+
as published by the Free Software Foundation; either version 2
45+
of the License, or (at your option) any later version. For
46+
more details read LICENSE in the root of this distribution.
47+
48+
This program is distributed in the hope that it will be useful,
49+
but WITHOUT ANY WARRANTY; without even the implied warranty of
50+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
51+
52+
As per the GPL, removal of this notice is prohibited.

core/lib/Foswiki/Configure/Checkers/LoginManager.pm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ will have to log in every time you access an authenticated page. To avoid
3636
this, you are recommended to turn {UseClientSessions} on.
3737
HERE
3838
}
39+
if ( $Foswiki::cfg{LoginManager} =~ /ApacheLogin$/
40+
&& ($Foswiki::cfg{Htpasswd}{Encoding} eq 'md5') )
41+
{
42+
$e .= $this->WARN(<<'HERE');
43+
Combining ApacheLogin and md5 password encoding requires the foswiki
44+
Authentication settings in the web server setup to be set to use Digest mode.
45+
This also requires the AuthName setting in the webserver
46+
configuration to be the same as the foswiki AuthRealm setting.
47+
HERE
48+
}
49+
3950
return $e;
4051
}
4152

core/lib/Foswiki/Contrib/core/MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ lib/Foswiki/Cache/MemoryLRU.pm 0444
431431
lib/Foswiki/Cache.pm 0444
432432
lib/Foswiki/Compatibility.pm 0444
433433
lib/Foswiki/Configure/Checker.pm 0444
434+
lib/Foswiki/Configure/Checkers/AuthRealm.pm 0444
434435
lib/Foswiki/Configure/Checkers/AuthScripts.pm 0444
435436
lib/Foswiki/Configure/Checkers/AllowInlineScript.pm 0444
436437
lib/Foswiki/Configure/Checkers/BasicSanity.pm 0444

0 commit comments

Comments
 (0)