~kosova/+junk/tuxfamily-twiki

« back to all changes in this revision

Viewing changes to foswiki/lib/Foswiki/Configure/Checkers/UseClientSessions.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::UseClientSessions;
 
3
 
 
4
use strict;
 
5
 
 
6
use Foswiki::Configure::Checker;
 
7
 
 
8
use base 'Foswiki::Configure::Checker';
 
9
 
 
10
my @modules = (
 
11
    {
 
12
        name            => 'CGI::Session',
 
13
        usage           => "Sessions",
 
14
        requiredVersion => 1,
 
15
    },
 
16
    {
 
17
        name               => 'CGI::Cookie',
 
18
        usage              => "Sessions",
 
19
        recommendedVersion => 1,
 
20
    },
 
21
);
 
22
 
 
23
sub check {
 
24
    my $this = shift;
 
25
 
 
26
    my $mess = '';
 
27
    if ( !eval "use CGI::Cookie; 1" ) {
 
28
        $mess .= <<HERE;
 
29
The CGI::Cookie Perl module is required for session support, but is not
 
30
available.
 
31
HERE
 
32
    }
 
33
    if ( !eval "use CGI::Session; 1" ) {
 
34
        $mess .= <<HERE;
 
35
The CGI::Session Perl module is required for session support, but is not
 
36
available.
 
37
HERE
 
38
    }
 
39
    if ($mess) {
 
40
        if ( $Foswiki::cfg{UseClientSessions} ) {
 
41
            $mess = $this->ERROR($mess);
 
42
        }
 
43
        else {
 
44
            $mess = $this->WARN($mess);
 
45
        }
 
46
    }
 
47
    return $mess;
 
48
}
 
49
 
 
50
1;
 
51
__DATA__
 
52
#
 
53
# Foswiki - The Free and Open Source Wiki, http://foswiki.org/
 
54
#
 
55
# Copyright (C) 2008 Foswiki Contributors. All Rights Reserved.
 
56
# Foswiki Contributors are listed in the AUTHORS file in the root
 
57
# of this distribution. NOTE: Please extend that file, not this notice.
 
58
#
 
59
# Additional copyrights apply to some or all of the code in this
 
60
# file as follows:
 
61
#
 
62
# Copyright (C) 2000-2006 TWiki Contributors. All Rights Reserved.
 
63
# TWiki Contributors are listed in the AUTHORS file in the root
 
64
# of this distribution. NOTE: Please extend that file, not this notice.
 
65
#
 
66
# This program is free software; you can redistribute it and/or
 
67
# modify it under the terms of the GNU General Public License
 
68
# as published by the Free Software Foundation; either version 2
 
69
# of the License, or (at your option) any later version. For
 
70
# more details read LICENSE in the root of this distribution.
 
71
#
 
72
# This program is distributed in the hope that it will be useful,
 
73
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
74
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
75
#
 
76
# As per the GPL, removal of this notice is prohibited.