lib/TWiki/Configure/Checkers/LoginManager.pm
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
permissions -rw-r--r--
RELEASE 4.2.0 freetown
     1 #
     2 # TWiki Enterprise Collaboration Platform, http://TWiki.org/
     3 #
     4 # Copyright (C) 2000-2006 TWiki Contributors.
     5 #
     6 # This program is free software; you can redistribute it and/or
     7 # modify it under the terms of the GNU General Public License
     8 # as published by the Free Software Foundation; either version 2
     9 # of the License, or (at your option) any later version. For
    10 # more details read LICENSE in the root of this distribution.
    11 #
    12 # This program is distributed in the hope that it will be useful,
    13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    15 #
    16 # As per the GPL, removal of this notice is prohibited.
    17 package TWiki::Configure::Checkers::LoginManager;
    18 
    19 use strict;
    20 
    21 use TWiki::Configure::Checker;
    22 
    23 use base 'TWiki::Configure::Checker';
    24 
    25 sub check {
    26     my $this = shift;
    27     my $e = '';
    28     # Rename from old "Client" to new "LoginManager" - see Bugs:Item3375
    29     $TWiki::cfg{LoginManager} =~ s/::Client::/::LoginManager::/;
    30     if( $TWiki::cfg{LoginManager} =~ /ApacheLogin$/ &&
    31           !$TWiki::cfg{UseClientSessions} ) {
    32         $e .= $this->WARN(<<'HERE');
    33 ApacheLogin uses the standard <code>REMOTE_USER</code>
    34 environment variable to identify a previously logged in user. This
    35 variable is only set if the script is authed by Apache. Thus if you
    36 visit a page view using a script that is <i>not</i> authed (such as
    37 <code>view</code>) then you will <i>appear</i> not to be logged in.
    38 However you are, really, and as soon as you use a script that <i>is</i>
    39 authed, your old identity will pop up again.
    40 So you really need {UseClientSessions} enabled for a login to "stick".
    41 HERE
    42     }
    43     if( $TWiki::cfg{LoginManager} =~ /TemplateLogin$/ &&
    44           !$TWiki::cfg{UseClientSessions} ) {
    45         $e .= $this->WARN(<<'HERE');
    46 TemplateLogin needs some way to remember who you are, otherwise you
    47 will have to log in every time you access an authenticated page. To avoid
    48 this, you are recommended to turn {UseClientSessions} on.
    49 HERE
    50     }
    51     return $e;
    52 }
    53 
    54 1;