NAME

Bric::App::Auth - Does the dirty work of authentication.

VERSION

$Revision: 1.8 $

DATE

$Date: 2002/01/06 04:40:35 $

SYNOPSIS

<Perl>
use lib '/usr/local/bricolage/lib';
</Perl>
<VirtualHost _default_:443>
    ErrorLog /usr/local/apache/logs/error_log
    TransferLog /usr/local/apache/logs/access_log
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXP56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt
    SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key
    <Location /login>
        SetHandler perl-script
        PerlHandler Bric::App::Auth
    </Location>
</VirtualHost>

DESCRIPTION

This module handles the user authentication.

INTERFACE

Constructors

NONE.

Destructors

NONE.

Public Class Methods

NONE.

Public Functions

my ($res, $msg) = auth($r)

Checks to see if the user is logged in to the current session. Used by Bric::App::AccessHandler.

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

my ($bool, $msg) = login($r, $username, $password)

Logs the user into Bricolage, setting the authentication cookie to allow future access that can be checked by a call to auth(). $bool is true on successful login. $bool is undef on failed login, and $msg contains the reason why the login failed.

Throws: None.

Side Effects: NONE.

Notes: NONE.

my $bool = logout($r)

Logs the currently logged-in user out.

Throws: None.

Side Effects: NONE.

Notes: NONE.

PRIVATE

Private Class Methods

NONE.

Private Instance Methods

NONE.

Private Functions

4
my $cookie = &$make_cookie($r, $username)
my $cookie = &$make_cookie($r, $username, $lul_time)

Bakes the authentication cookie.

Throws: None.

Side Effects: NONE.

Notes: NONE.

my ($hash, $exp, $ip) = &$make_hash($r, $un)
my ($hash, $exp, $ip) = &$make_hash($r, $un, $exp, $ip, $lul)

Returns the data points required for baking cookies. These include the MD5 hash, the expiration time, and the IP subnet.

Throws: None.

Side Effects: NONE.

Notes: NONE.

my ($ret, $msg) = &$fail($r, $msg)

Expires the user session and then returns an error message explaining why the user wasn't able to authenticate.

Throws:

Side Effects: NONE.

Notes: NONE.

NOTES

NONE.

AUTHOR

David Wheeler <david@wheeler.net>

SEE ALSO

Bric

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 240:

You forgot a '=back' before '=head1'