~kosova/+junk/tuxfamily-twiki

« back to all changes in this revision

Viewing changes to foswiki/lib/Foswiki/Configure/Checkers/Htpasswd/Encoding.pm

  • Committer: James Michael DuPont
  • Date: 2009-07-18 19:58:49 UTC
  • Revision ID: jamesmikedupont@gmail.com-20090718195849-vgbmaht2ys791uo2
added foswiki

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# See bottom of file for license and copyright information
 
2
package Foswiki::Configure::Checkers::Htpasswd::Encoding;
 
3
use base 'Foswiki::Configure::Checker';
 
4
 
 
5
use strict;
 
6
 
 
7
sub check {
 
8
    my $this = shift;
 
9
 
 
10
    my $enc = $Foswiki::cfg{Htpasswd}{Encoding};
 
11
    my $e   = '';
 
12
 
 
13
    if ( $enc eq 'digest' ) {
 
14
        $e .= $this->checkPerlModules(
 
15
            name           => 'Digest::MD5',
 
16
            usage          => "MD5 encoded passwords",
 
17
            minimumVersion => 1,
 
18
            disposition    => 'required'
 
19
        );
 
20
    }
 
21
    elsif ( $enc eq 'sha1' ) {
 
22
        $e .= $this->checkPerlModules(
 
23
            name           => 'MIME::Base64',
 
24
            usage          => "SHA1 password encoding",
 
25
            minimumVersion => 1,
 
26
            disposition    => 'required'
 
27
        );
 
28
    }
 
29
    my $pe = $this->checkTreePerms( $Foswiki::cfg{Htpasswd}{FileName}, 'r' );
 
30
    $e .= $this->ERROR($pe) if $pe;
 
31
    return $e;
 
32
}
 
33
 
 
34
1;
 
35
__DATA__
 
36
#
 
37
# Foswiki - The Free and Open Source Wiki, http://foswiki.org/
 
38
#
 
39
# Copyright (C) 2008 Foswiki Contributors. All Rights Reserved.
 
40
# Foswiki Contributors are listed in the AUTHORS file in the root
 
41
# of this distribution. NOTE: Please extend that file, not this notice.
 
42
#
 
43
# Additional copyrights apply to some or all of the code in this
 
44
# file as follows:
 
45
#
 
46
# Copyright (C) 2000-2006 TWiki Contributors. All Rights Reserved.
 
47
# TWiki Contributors are listed in the AUTHORS file in the root
 
48
# of this distribution. NOTE: Please extend that file, not this notice.
 
49
#
 
50
# This program is free software; you can redistribute it and/or
 
51
# modify it under the terms of the GNU General Public License
 
52
# as published by the Free Software Foundation; either version 2
 
53
# of the License, or (at your option) any later version. For
 
54
# more details read LICENSE in the root of this distribution.
 
55
#
 
56
# This program is distributed in the hope that it will be useful,
 
57
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
58
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
59
#
 
60
# As per the GPL, removal of this notice is prohibited.