Apache-AuthenMT

 view release on metacpan or  search on metacpan

AuthenMT.pm  view on Meta::CPAN

use Apache::Constants qw(:common);
use MT::App;
use MT::Author;

# authentication handler
sub handler {
    my $r      = shift;
    my $MT_DIR = $r->dir_config("MT_DIR");
    my $reason;

    # get user's authentication credentials
    my($res, $sent_pw) = $r->get_basic_auth_pw;
    return $res if $res != OK;
    my $user = $r->connection->user;
    
    # start up Movable Type
    my $app = MT::App->new( 
        Config    => $MT_DIR . 'mt.cfg',
        Directory => $MT_DIR 
    ) or $reason = MT::App::->errstr;



( run in 0.233 second using v1.01-cache-2.11-cpan-a5abf4f5562 )