]> ruin.nu Git - ndwebbie.git/blob - lib/NDWeb.pm
Converted users to catalyst
[ndwebbie.git] / lib / NDWeb.pm
1 package NDWeb;
2
3 use strict;
4 use warnings;
5
6 use Catalyst::Runtime '5.70';
7
8 #Need to preload, otherwise the first hit is slow
9 use CGI qw/:standard/;
10 escapeHTML('');
11
12 # Set flags and add plugins for the application
13 #
14 #         -Debug: activates the debug mode for very useful log messages
15 #   ConfigLoader: will load the configuration from a YAML file in the
16 #                 application's home directory
17 # Static::Simple: will serve static files from the application's root 
18 #                 directory
19
20 use parent qw/Catalyst/;
21
22 our $VERSION = '0.01';
23
24 # Configure the application. 
25 #
26 # Note that settings in ndweb.yml (or other external
27 # configuration file that you set up manually) take precedence
28 # over this when using ConfigLoader. Thus configuration
29 # details given here can function as a default configuration,
30 # with a external configuration file acting as an override for
31 # local deployment.
32
33 __PACKAGE__->config( name => 'NDWeb' );
34 __PACKAGE__->config->{'Plugin::Authentication'}{'use_session'} = 1;
35
36
37
38 # Start the application
39 __PACKAGE__->setup(qw/
40         -Debug
41         ConfigLoader
42         Static::Simple
43
44         Authentication
45         Authentication::Store::NDWeb
46         Authentication::Credential::Password
47
48         Authorization::Roles
49         Authorization::ACL
50         
51         Session
52         Session::Store::File
53         Session::State::Cookie
54         /);
55
56 __PACKAGE__->deny_access_unless('/users',[qw/admin_users/]);
57
58 =head1 NAME
59
60 NDWeb - Catalyst based application
61
62 =head1 SYNOPSIS
63
64     script/ndweb_server.pl
65
66 =head1 DESCRIPTION
67
68 [enter your description here]
69
70 =head1 SEE ALSO
71
72 L<NDWeb::Controller::Root>, L<Catalyst>
73
74 =head1 AUTHOR
75
76 Catalyst developer
77
78 =head1 LICENSE
79
80 This library is free software, you can redistribute it and/or modify
81 it under the same terms as Perl itself.
82
83 =cut
84
85 1;