use Catalyst::Runtime 5.80;
-# Set flags and add plugins for the application
-#
-# -Debug: activates the debug mode for very useful log messages
-# ConfigLoader: will load the configuration from a Config::General file in the
-# application's home directory
-# Static::Simple: will serve static files from the application's root
-# directory
-
use Catalyst qw/
-Debug
- Static::Simple
-
Authentication
- Authorization::Roles
Session
Session::State::Cookie
Session::Store::FastMmap
extends 'Catalyst';
our $VERSION = '0.01';
-$VERSION = eval $VERSION;
# Configure the application.
#
"store" => {
"binddn" => "anonymous",
"bindpw" => "dontcare",
-
"class" => "LDAP",
-
"ldap_server" => "ldap.test.no",
"ldap_server_options" => {
"timeout" => 30,
"port" => "636",
"scheme" => "ldaps"
},
-
"role_basedn" => "ou=stavanger,o=test,c=no",
"role_field" => "cn",
"role_filter" => "(&(objectClass=groupOfNames)(member=%s))",
}
);
-
-# Start the application
__PACKAGE__->setup();
-
-=head1 NAME
-
-Test::LDAP - Catalyst based application
-
-=head1 SYNOPSIS
-
- script/test_ldap_web_server.pl
-
-=head1 DESCRIPTION
-
-[enter your description here]
-
-=head1 SEE ALSO
-
-L<Test::LDAP::Controller::Root>, L<Catalyst>
-
-=head1 AUTHOR
-
-root
-
-=head1 LICENSE
-
-This library is free software. You can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
-
1;
BEGIN {extends 'Catalyst::Controller'; }
-=head1 NAME
-
-Test::LDAP::Controller::Auth - Catalyst Controller
-
-=head1 DESCRIPTION
-
-Catalyst Controller.
-
-=head1 METHODS
-
-=cut
-
-
-=head2 index
-
-=cut
sub index :Path :Args(0) {
my ( $self, $c ) = @_;
$c->response->redirect( $c->uri_for( $c->controller("Root")->action_for("index") ) )
}
-=head1 AUTHOR
-
-root
-
-=head1 LICENSE
-
-This library is free software. You can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
-
__PACKAGE__->meta->make_immutable;
1;
BEGIN { extends 'Catalyst::Controller' }
-#
-# Sets the actions in this controller to be registered with no prefix
-# so they function identically to actions created in MyApp.pm
-#
__PACKAGE__->config(namespace => '');
-=head1 NAME
-
-Test::LDAP::Controller::Root - Root Controller for Test::LDAP
-
-=head1 DESCRIPTION
-
-[enter your description here]
-
-=head1 METHODS
-
-=head2 itndex
-
-The root page (/)
-
-=cut
-
sub index :Path :Args(0) {
my ( $self, $c ) = @_;
$c->res->body("Index");
}
-=head2 default
-
-Standard 404 error page
-
-=cut
-
sub default :Path {
my ( $self, $c ) = @_;
$c->res->status(404);
}
-=head2 end
-
-Attempt to render a view, if needed.
-
-=cut
-
-sub end : ActionClass('RenderView') {
- my ($self, $c) = @_;
- my $errors = scalar @{$c->error};
-
- if ($errors) {
- $c->res->body("Internal error");
- $c->res->status("500");
- $c->clear_errors;
- }
-}
-
-=head1 AUTHOR
-
-root
-
-=head1 LICENSE
-
-This library is free software. You can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
+sub end {}
__PACKAGE__->meta->make_immutable;
use Moose;
use namespace::autoclean;
-BEGIN {extends 'Catalyst::Controller::HTML::FormFu'; }
-
-=head1 NAME
-
-Test::LDAP::Controller::User - Catalyst Controller
-
-=head1 DESCRIPTION
-
-Catalyst Controller.
-
-=head1 METHODS
-
-=cut
-
-
-=head2 index
-
-=cut
+BEGIN {extends 'Catalyst::Controller'; }
sub base :Chained('/') :PathPart('user') :CaptureArgs(0) {
my ($self, $c) = @_;
}
}
-=head2 auto
-
-Check if the user is authenicated, if not we just forward to the login page.
-
-=cut
sub auto :Private {
my ( $self, $c ) = @_;
return 1
}
-
-=head1 AUTHOR
-
-root
-
-=head1 LICENSE
-
-This library is free software. You can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
-
__PACKAGE__->meta->make_immutable;
1;
use Moose;
use namespace::autoclean;
extends 'Catalyst::Model::LDAP::FromAuthentication';
+
+1;
+